about summary refs log tree commit diff
path: root/src/nix-env
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T20·19+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-04T20·19+0200
commitbd9b1d97b42f307c8b595bb2de9b15bec1405b23 (patch)
tree48bd5555658fb2c734bf85ce8bd35eace826cb68 /src/nix-env
parent8160f794e79a4a2a5269080b408d69fc93d7a305 (diff)
Show position info in string concatenation / addition errors
Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/user-env.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc
index a95c4cba937f..e71ad34edbc5 100644
--- a/src/nix-env/user-env.cc
+++ b/src/nix-env/user-env.cc
@@ -121,8 +121,10 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
     debug("evaluating user environment builder");
     state.forceValue(topLevel);
     PathSet context;
-    Path topLevelDrv = state.coerceToPath(*topLevel.attrs->find(state.sDrvPath)->value, context);
-    Path topLevelOut = state.coerceToPath(*topLevel.attrs->find(state.sOutPath)->value, context);
+    Attr & aDrvPath(*topLevel.attrs->find(state.sDrvPath));
+    Path topLevelDrv = state.coerceToPath(aDrvPath.pos ? *(aDrvPath.pos) : noPos, *(aDrvPath.value), context);
+    Attr & aOutPath(*topLevel.attrs->find(state.sOutPath));
+    Path topLevelOut = state.coerceToPath(aOutPath.pos ? *(aOutPath.pos) : noPos, *(aOutPath.value), context);
 
     /* Realise the resulting store expression. */
     debug("building user environment");