From 33e2f00fb710b2f63e9daa690c4eaad1e6eb3bad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 3 Nov 2016 17:50:32 +0200 Subject: Print empty name as '' rather than {} in quoted mode --- build2/name.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'build2/name.cxx') 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 ()); -- cgit v1.1