1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00

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.
This commit is contained in:
Eelco Dolstra 2020-06-05 10:45:05 +02:00
parent ef798f73ea
commit 39e84c35d0

View file

@ -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);