diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-03 17:50:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:37 +0200 |
commit | 33e2f00fb710b2f63e9daa690c4eaad1e6eb3bad (patch) | |
tree | 28bd04d4ace1dca2433da6bdd6de8cd5dde9e2f4 /build2/name.cxx | |
parent | 57c7577fa91ffc024e5c696a91abe19f5547a787 (diff) |
Print empty name as '' rather than {} in quoted mode
Diffstat (limited to 'build2/name.cxx')
-rw-r--r-- | build2/name.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/build2/name.cxx b/build2/name.cxx index de1ee51..5f6762d 100644 --- a/build2/name.cxx +++ b/build2/name.cxx @@ -62,6 +62,11 @@ namespace build2 os << d; }; + // If quoted then print empty name as '' rather than {}. + // + if (quote && n.empty () && n.proj == nullptr) + return os << "''"; + if (n.proj != nullptr) { write_string (*n.proj); @@ -70,7 +75,7 @@ namespace build2 // If the value is empty, then we want to print the directory // inside {}, e.g., dir{bar/}, not bar/dir{}. We also want to - // print {} for an empty name. + // print {} for an empty name (unless quoted). // bool d (!n.dir.empty ()); bool v (!n.value.empty ()); |