From ad7d4bd0722aa70ba634900cebf93a1b1814fed9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Jul 2016 16:09:49 +0200 Subject: Only do "effective escaping" (['"\$(]) on the command line This will make things more convenient on Windows provided we use "sane" paths (no spaces, no (), etc). --- build2/context.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'build2/context.cxx') diff --git a/build2/context.cxx b/build2/context.cxx index e08fb52..f756bfc 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -97,7 +97,12 @@ namespace build2 { istringstream is (s); is.exceptions (istringstream::failbit | istringstream::badbit); - lexer l (is, path ("")); + + // Similar to buildspec we do "effective escaping" and only for ['"\$(] + // (basically what's necessary inside a double-quoted literal plus the + // single quote). + // + lexer l (is, path (""), "\'\"\\$("); // The first token should be a name, either the variable name or the // scope qualification. @@ -143,7 +148,7 @@ namespace build2 if (c == '!' && !dir.empty ()) fail << "scope-qualified global override of variable " << n; - variable_visibility v (c == '/' ? variable_visibility::scope : + variable_visibility v (c == '/' ? variable_visibility::scope : c == '%' ? variable_visibility::project : variable_visibility::normal); -- cgit v1.1