about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17T10·58+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17T10·58+0000
commitcf705eaf78df646116f2fc14e6fa07d88f1607fe (patch)
tree7d4fdc12d93a011ded1e909cdd9d77a334ff2102 /src/libexpr
parent7de5fe2fc2cf4ceafc421697ad0bfb0a6e2d994d (diff)
* toString: don't copy paths. So toString can be used to pass
  non-store paths to a builder.

Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 2fbfa538ffc4..536345f2294c 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -324,12 +324,13 @@ static Expr primDirOf(EvalState & state, const ATermVector & args)
 }
 
 
-/* Convert the argument to a string. */
+/* Convert the argument to a string.  Paths are *not* copied to the
+   store, so `toString /foo/bar' yields `"/foo/bar"', not
+   `"/nix/store/whatever..."'. */
 static Expr primToString(EvalState & state, const ATermVector & args)
 {
     PathSet context;
-    string s = coerceToString(state, args[0], context);
-    /* !!! do lists etc */
+    string s = coerceToString(state, args[0], context, true, false);
     return makeStr(s, context);
 }