about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-16T22·39+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-16T22·39+0200
commitd6a7aa8f4827f97856ed55226426c355e1d1b4d1 (patch)
tree974ab95bdac1c1d17ea2404c1dd08adac1a52672 /src
parentb8571d68c4f2c0b4b0b8f3d7c7ef09668aab140f (diff)
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/<hash>-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/<hash>-foo/bar".  So revert to the old
behaviour.
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/eval.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 0e15a8d9374e..a3aeeb55c02c 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<Expr *>::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)