From a322306247019d65b943b11989eeb8d26d481fd0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 14 Dec 2022 13:21:54 +0100 Subject: [PATCH] For backward compatibility, allow appending non-root paths to the root FS This makes let foo = "foo"; in /${foo} work again. --- src/libexpr/eval.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 93e88d038..1447ab07c 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1998,7 +1998,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v) } else if (firstType == nPath) { if (!first) { 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, "cannot append non-absolute path '%1%' to '%2%' (hint: change it to '/%1%')", (std::string) *part, accessor->root().to_string(),