diff options
Diffstat (limited to 'libbuild2/script/run.cxx')
-rw-r--r-- | libbuild2/script/run.cxx | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/libbuild2/script/run.cxx b/libbuild2/script/run.cxx index 1ce5564..cbd750f 100644 --- a/libbuild2/script/run.cxx +++ b/libbuild2/script/run.cxx @@ -1715,13 +1715,7 @@ namespace build2 auto process_args = [&c] () -> cstrings { - cstrings args {c.program.recall_string ()}; - - for (const auto& a: c.arguments) - args.push_back (a.c_str ()); - - args.push_back (nullptr); - return args; + return build2::process_args (c.program.recall_string (), c.arguments); }; // Prior to opening file descriptors for command input/output redirects @@ -2450,30 +2444,27 @@ namespace build2 if (!valid || (!success && diag)) { - dr << error (ll) << w << ' '; + dr << error (ll) << w << ' ' << pr << ' '; if (!exit->normal ()) - dr << pr << ' ' << *exit; + dr << *exit; else { uint16_t ec (exit->code ()); // Make sure printed as integer. if (!valid) - dr << pr << " exit code " << ec << " out of 0-255 range"; - else if (!success) + dr << "exit code " << ec << " out of 0-255 range"; + else { - if (diag) - { - if (cmd.exit) - dr << pr << " exit code " << ec - << (cmp == exit_comparison::eq ? " != " : " == ") - << exc; - else - dr << pr << " exited with code " << ec; - } + assert (!success && diag); + + if (cmd.exit) + dr << "exit code " << ec + << (cmp == exit_comparison::eq ? " != " : " == ") + << exc; + else + dr << "exited with code " << ec; } - else - assert (false); } if (verb == 1) |