From 7de5fe2fc2cf4ceafc421697ad0bfb0a6e2d994d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 17 Oct 2006 10:57:25 +0000 Subject: [PATCH] * Do the path check on the normal form. --- src/libexpr/eval.cc | 7 +++++-- 1 file 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;