From 659535a1792527d885f5de68afd84d4241fcb0b3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 23 Aug 2016 09:12:14 +0200 Subject: Don't write trailing spaces in case of empty values in config.build --- build2/config/operation.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'build2/config') 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 -- cgit v1.1