From cb7168f9a7db37b5c733ed4ccb15e00037420388 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 23 Jul 2016 08:38:53 +0200 Subject: Fix module separating blank line logic --- build2/config/operation.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'build2/config') 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. -- cgit v1.1