mirror of
https://github.com/NixOS/nix
synced 2025-06-29 19:03:16 +02:00
For backward compatibility, allow appending non-root paths to the root FS
This makes let foo = "foo"; in /${foo} work again.
This commit is contained in:
parent
12c554acd4
commit
a322306247
1 changed files with 1 additions and 1 deletions
|
@ -1998,7 +1998,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
|
||||||
} else if (firstType == nPath) {
|
} else if (firstType == nPath) {
|
||||||
if (!first) {
|
if (!first) {
|
||||||
auto part = state.coerceToString(i_pos, *vTmp, context, false, false);
|
auto part = state.coerceToString(i_pos, *vTmp, context, false, false);
|
||||||
if (sSize <= 1 && !hasPrefix(*part, "/"))
|
if (sSize <= 1 && !hasPrefix(*part, "/") && accessor != state.rootFS.get_ptr())
|
||||||
state.throwEvalError(i_pos,
|
state.throwEvalError(i_pos,
|
||||||
"cannot append non-absolute path '%1%' to '%2%' (hint: change it to '/%1%')",
|
"cannot append non-absolute path '%1%' to '%2%' (hint: change it to '/%1%')",
|
||||||
(std::string) *part, accessor->root().to_string(),
|
(std::string) *part, accessor->root().to_string(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue