From d6a7aa8f4827f97856ed55226426c355e1d1b4d1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 17 Oct 2013 00:39:59 +0200 Subject: Revert the behaviour of antiquoted paths to pre-Nix 1.6 Commit 159e621d1a9c4391b53f3d822109c36931934698 accidentally changed the behaviour of antiquoted paths, e.g. "${/foo}/bar" used to evaluate to "/nix/store/-foo/bar" (where /foo gets copied to the store), but in Nix 1.6 it evaluates to "/foo/bar". This is inconsistent, since " ${/foo}/bar" evaluates to " /nix/store/-foo/bar". So revert to the old behaviour. --- src/libexpr/eval.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 0e15a8d93..a3aeeb55c 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -959,8 +959,8 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v) std::ostringstream s; NixInt n = 0; - bool first = true; - ValueType firstType; + bool first = !forceString; + ValueType firstType = tString; foreach (vector::iterator, i, *es) { Value vTmp; @@ -975,12 +975,12 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v) first = false; } - if (firstType == tInt && !forceString) { + if (firstType == tInt) { if (vTmp.type != tInt) throwEvalError("cannot add %1% to an integer", showType(vTmp)); n += vTmp.integer; } else - s << state.coerceToString(vTmp, context, false, firstType != tPath); + s << state.coerceToString(vTmp, context, false, firstType == tString); } if (firstType == tInt) -- cgit v1.2.3