From 6b7830d23afba1ca252e46b1393d3b1d439a7193 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Sat, 5 Feb 2011 11:32:40 -0800 Subject: [PATCH] include command name when printing output, add newline --- src/build.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/build.cc b/src/build.cc index b380845..254d4dc 100644 --- a/src/build.cc +++ b/src/build.cc @@ -268,12 +268,16 @@ Edge* RealCommandRunner::NextFinishedCommand(bool* success) { Edge* edge = i->second; subproc_to_edge_.erase(i); - if (!*success) - printf("FAILED: %s\n", edge->EvaluateCommand().c_str()); - if (!subproc->stdout_.buf_.empty()) - printf("%s\n", subproc->stdout_.buf_.c_str()); - if (!subproc->stderr_.buf_.empty()) - printf("%s\n", subproc->stderr_.buf_.c_str()); + if (!*success || + !subproc->stdout_.buf_.empty() || + !subproc->stderr_.buf_.empty()) { + printf("\n%s%s\n", *success ? "" : "FAILED: ", + edge->EvaluateCommand().c_str()); + if (!subproc->stdout_.buf_.empty()) + printf("%s\n", subproc->stdout_.buf_.c_str()); + if (!subproc->stderr_.buf_.empty()) + printf("%s\n", subproc->stderr_.buf_.c_str()); + } delete subproc; return edge; -- 2.7.4