summaryrefslogtreecommitdiffstats
path: root/src/line_printer.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-04-09 04:14:29 (GMT)
committerNico Weber <nicolasweber@gmx.de>2013-04-09 04:14:29 (GMT)
commitf872a912c57879767a7715094790aa4380badce2 (patch)
tree48a39563504b5890e6ce6f61bc448887c19c3b81 /src/line_printer.cc
parent7920d7032a8833004fc281fb5b090787888d0fd0 (diff)
downloadNinja-f872a912c57879767a7715094790aa4380badce2.zip
Ninja-f872a912c57879767a7715094790aa4380badce2.tar.gz
Ninja-f872a912c57879767a7715094790aa4380badce2.tar.bz2
move printing of new lines into LinePrinter.
Diffstat (limited to 'src/line_printer.cc')
-rw-r--r--src/line_printer.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/line_printer.cc b/src/line_printer.cc
index 54f0a5b..bfa737e 100644
--- a/src/line_printer.cc
+++ b/src/line_printer.cc
@@ -96,3 +96,10 @@ void LinePrinter::Print(std::string to_print, LineType type) {
printf("%s\n", to_print.c_str());
}
}
+
+void LinePrinter::PrintOnNewLine(const string& to_print) {
+ if (!have_blank_line_)
+ printf("\n");
+ printf("%s", to_print.c_str());
+ have_blank_line_ = to_print.empty() || *to_print.rbegin() == '\n';
+}