aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-03-10 17:31:47 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-03-11 12:57:10 +0300
commita061301ab789d00027f29f389627792dccbe1748 (patch)
tree79c83ae472f6fca965bbe3fc05a9ba3a16197878
parent3fa110a72463dd3b4849d9b2d8f53ab9cb62d86b (diff)
Allow effective quoting for names that need curly braces in their representations
-rw-r--r--libbuild2/name.cxx7
-rw-r--r--libbuild2/name.hxx2
2 files changed, 4 insertions, 5 deletions
diff --git a/libbuild2/name.cxx b/libbuild2/name.cxx
index a285459..6c48bb3 100644
--- a/libbuild2/name.cxx
+++ b/libbuild2/name.cxx
@@ -90,10 +90,9 @@ namespace build2
bool curly = false)
{
// We don't expect the effective quoting mode to be specified for the
- // name patterns or names that need curly braces in their
- // representations.
+ // name patterns.
//
- assert (q != quote_mode::effective || (!pat && !curly));
+ assert (q != quote_mode::effective || !pat);
// Special characters, path pattern characters, and regex pattern
// characters. The latter only need to be quoted in the first position
@@ -121,7 +120,7 @@ namespace build2
};
char esc[] = {
- '$', '(', // Token endings.
+ '{', '}', '$', '(', // Token endings.
' ', '\t', '\n', '#', // Spaces.
'"', // Quoting.
pair, // Pair separator, if any.
diff --git a/libbuild2/name.hxx b/libbuild2/name.hxx
index 795cd5c..7d179aa 100644
--- a/libbuild2/name.hxx
+++ b/libbuild2/name.hxx
@@ -201,7 +201,7 @@ namespace build2
//
// In the effective quoting mode the special characters are:
//
- // $( \t\n#"'
+ // {}$( \t\n#"'
//
// As well as `\` if followed by any of the above characters or itself.
//