summaryrefslogtreecommitdiff
path: root/ninja/src/line_printer.cc
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-11-21 14:09:57 +0100
committerAndras Becsi <andras.becsi@digia.com>2013-11-29 15:14:36 +0100
commiteb32ba6f51d0c21d58cd7d89785285ff8fa64624 (patch)
tree2c7c940e1dbee81b89d935626110816b494aa32c /ninja/src/line_printer.cc
parent9427c1a0222ebd67efef1a2c7990a0fa5c9aac84 (diff)
downloadqtwebengine-chromium-eb32ba6f51d0c21d58cd7d89785285ff8fa64624.tar.gz
Update chromium to branch 1599.
Change-Id: I04e775a946a208bb4500d3b722bcb05c82b9d7cb Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'ninja/src/line_printer.cc')
-rw-r--r--ninja/src/line_printer.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/ninja/src/line_printer.cc b/ninja/src/line_printer.cc
index a75eb0505f4..3537e886e69 100644
--- a/ninja/src/line_printer.cc
+++ b/ninja/src/line_printer.cc
@@ -104,6 +104,10 @@ void LinePrinter::Print(string to_print, LineType type) {
void LinePrinter::PrintOnNewLine(const string& to_print) {
if (!have_blank_line_)
printf("\n");
- printf("%s", to_print.c_str());
+ if (!to_print.empty()) {
+ // Avoid printf and C strings, since the actual output might contain null
+ // bytes like UTF-16 does (yuck).
+ fwrite(&to_print[0], sizeof(char), to_print.size(), stdout);
+ }
have_blank_line_ = to_print.empty() || *to_print.rbegin() == '\n';
}