aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.