aboutsummaryrefslogtreecommitdiff
path: root/build2/config
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-23 08:38:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-25 08:05:43 +0200
commitcb7168f9a7db37b5c733ed4ccb15e00037420388 (patch)
treec6ed62e137a9fd60198b76dfb1a8f039b7ed2067 /build2/config
parent2d9579da2144b2a8d67ea1d05fde96ec9d365944 (diff)
Fix module separating blank line logic
Diffstat (limited to 'build2/config')
-rw-r--r--build2/config/operation.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/build2/config/operation.cxx b/build2/config/operation.cxx
index 617e74c..6a83273 100644
--- a/build2/config/operation.cxx
+++ b/build2/config/operation.cxx
@@ -101,10 +101,7 @@ namespace build2
const string& sname (i->first);
const saved_variables& svars (i->second);
- // Separate modules with a blank line.
- //
- ofs << endl;
-
+ bool first (true); // Separate modules with a blank line.
for (const saved_variable& sv: svars)
{
const variable& var (sv.var);
@@ -219,6 +216,15 @@ namespace build2
continue;
}
+ // If we got here then we are saving this variable. Handle the
+ // blank line.
+ //
+ if (first)
+ {
+ ofs << endl;
+ first = false;
+ }
+
// Handle the save_commented flag.
//
if ((org.first.defined () && org.first->extra) && // Default value.