aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/in/rule.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/build2/in/rule.cxx b/build2/in/rule.cxx
index 545ded5..7b3904c 100644
--- a/build2/in/rule.cxx
+++ b/build2/in/rule.cxx
@@ -378,7 +378,9 @@ namespace build2
}
what = "write"; whom = &tp;
- ofs << s << endl;
+ if (ln != 1)
+ ofs << endl; // See below.
+ ofs << s;
}
// Close depdb before closing the output file so its mtime is not
@@ -387,6 +389,7 @@ namespace build2
dd.close ();
what = "close"; whom = &tp;
+ ofs << endl; // Last write to make sure our mtime is older than dd.
ofs.close ();
arm.cancel ();