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(),