aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17 10:57:25 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17 10:57:25 +0000
commit7de5fe2fc2cf4ceafc421697ad0bfb0a6e2d994d (patch)
treeadd60e0e611caf90968d9f4751c8cf87239c73b6 /src/libexpr
parent46b631b6c4a743b88bf2d6bb779c0f677e9b8318 (diff)
* Do the path check on the normal form.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 2bb29f871..df8be08c6 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -294,9 +294,11 @@ string coerceToString(EvalState & state, Expr e, PathSet & context,
/* Common implementation of `+', ConcatStrings and `~'. */
-static ATerm concatStrings(EvalState & state, const ATermVector & args,
+static ATerm concatStrings(EvalState & state, ATermVector & args,
string separator = "")
{
+ if (args.empty()) return makeStr("", PathSet());
+
PathSet context;
std::ostringstream s;
@@ -305,7 +307,8 @@ static ATerm concatStrings(EvalState & state, const ATermVector & args,
paths are copied when they are used in a derivation), and none
of the strings are allowed to have contexts. */
ATerm dummy;
- bool isPath = !args.empty() && matchPath(args.front(), dummy);
+ args.front() = evalExpr(state, args.front());
+ bool isPath = matchPath(args.front(), dummy);
for (ATermVector::const_iterator i = args.begin(); i != args.end(); ++i) {
if (i != args.begin()) s << separator;