aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-23 09:12:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-23 09:12:14 +0200
commit659535a1792527d885f5de68afd84d4241fcb0b3 (patch)
tree4d0c2f3803635644592917b36685a6aff73c62b3
parentbd32ea47fd8f720b54f81a769dc007d1fdb4e5c1 (diff)
Don't write trailing spaces in case of empty values in config.build
-rw-r--r--build2/config/operation.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/build2/config/operation.cxx b/build2/config/operation.cxx
index ca2d559..90c2bbb 100644
--- a/build2/config/operation.cxx
+++ b/build2/config/operation.cxx
@@ -252,9 +252,18 @@ namespace build2
if (v)
{
storage.clear ();
+ names_view ns (reverse (v, storage));
+
+ ofs << n;
+
+ if (ns.empty ())
+ ofs << " =";
+ else
+ {
+ ofs << " = ";
+ to_stream (ofs, ns, true, '@'); // Quote.
+ }
- ofs << n << " = ";
- to_stream (ofs, reverse (v, storage), true, '@'); // Quote.
ofs << endl;
}
else