From 5f18cd2e84bb4d7405f7dbcc8b6554365556a3a1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Feb 2013 19:49:24 +0100 Subject: Make "${./path} ..." evaluate to a string, not a path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wacky string coercion semantics caused expressions like exec = "${./my-script} params..."; to evaluate to a path (‘/path/my-script params’), because anti-quotations are desuged to string concatenation: exec = ./my-script + " params..."; By constrast, adding a space at the start would yield a string as expected: exec = " ${./my-script} params..."; Now the first example also evaluates to a string. --- src/libexpr/nixexpr.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libexpr/nixexpr.hh') diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index bc6c3287c79d..86a7bfd506a0 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -277,8 +277,10 @@ MakeBinOp(OpConcatLists, "++") struct ExprConcatStrings : Expr { + bool forceString; vector * es; - ExprConcatStrings(vector * es) : es(es) { }; + ExprConcatStrings(bool forceString, vector * es) + : forceString(forceString), es(es) { }; COMMON_METHODS }; -- cgit 1.4.1