Skip to content

Commit

Permalink
Fix log-prefix of nix build -L
Browse files Browse the repository at this point in the history
Alternative fix to #3661. The cause was that 'name' is a
std::string_view into a temporary which could get overwritten.
  • Loading branch information
edolstra committed Jun 5, 2020
1 parent ef798f7 commit 39e84c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nix/progress-bar.cc
Expand Up @@ -154,7 +154,7 @@ class ProgressBar : public Logger
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);
Expand Down

0 comments on commit 39e84c3

Please sign in to comment.