aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-05 10:45:05 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-05 10:45:05 +0200
commit39e84c35d0b8bf5b49f45736febd9f506e3ee4ae (patch)
tree4f382a41a7d697f4a84f58a1996f2fddcfa33205 /src/nix
parentef798f73ea14b19885bc533e0864da17f28be407 (diff)
Fix log-prefix of `nix build -L`
Alternative fix to #3661. The cause was that 'name' is a std::string_view into a temporary which could get overwritten.
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/progress-bar.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc
index 8e7ba95a3..c67701098 100644
--- a/src/nix/progress-bar.cc
+++ b/src/nix/progress-bar.cc
@@ -154,7 +154,7 @@ public:
state->activitiesByType[type].its.emplace(act, i);
if (type == actBuild) {
- auto name = storePathToName(getS(fields, 0));
+ std::string name(storePathToName(getS(fields, 0)));
if (hasSuffix(name, ".drv"))
name = name.substr(0, name.size() - 4);
i->s = fmt("building " ANSI_BOLD "%s" ANSI_NORMAL, name);