aboutsummaryrefslogtreecommitdiff
path: root/build2/name.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/name.cxx')
-rw-r--r--build2/name.cxx7
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 ());