mirror of
https://github.com/NixOS/nix
synced 2025-06-26 15:51:15 +02:00
Escape ${
in strings when printing Nix expressions
Otherwise the result of the printing can't be parsed back correctly by Nix (because the unescaped `${` will be parsed as the begining of an anti-quotation). Fix #3989
This commit is contained in:
parent
a59e77d9e5
commit
250f8a4bba
3 changed files with 3 additions and 2 deletions
|
@ -87,6 +87,7 @@ static void printValue(std::ostream & str, std::set<const Value *> & active, con
|
|||
else if (*i == '\n') str << "\\n";
|
||||
else if (*i == '\r') str << "\\r";
|
||||
else if (*i == '\t') str << "\\t";
|
||||
else if (*i == '$' && *(i+1) == '{') str << "\\" << *i;
|
||||
else str << *i;
|
||||
str << "\"";
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue