1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

Rename shellEscape -> escapeShellArgAlways

This name is close to the Nixpkgs lib function `escapeShellArg`,
making it easier to find.

A friendlier function with the same behavior as lib could be added
later.
This commit is contained in:
Robert Hensing 2025-04-23 13:14:28 +02:00
parent f186491db9
commit 1e5b1d9973
6 changed files with 25 additions and 20 deletions

View file

@ -497,7 +497,7 @@ static void opPrintEnv(Strings opFlags, Strings opArgs)
/* Print each environment variable in the derivation in a format
* that can be sourced by the shell. */
for (auto & i : drv.env)
logger->cout("export %1%; %1%=%2%\n", i.first, shellEscape(i.second));
logger->cout("export %1%; %1%=%2%\n", i.first, escapeShellArgAlways(i.second));
/* Also output the arguments. This doesn't preserve whitespace in
arguments. */
@ -506,7 +506,7 @@ static void opPrintEnv(Strings opFlags, Strings opArgs)
for (auto & i : drv.args) {
if (!first) cout << ' ';
first = false;
cout << shellEscape(i);
cout << escapeShellArgAlways(i);
}
cout << "'\n";
}