From 87d896f1107a077f3d1876f8feb9dcf9ee93ea3c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 6 Apr 2020 16:20:29 +0200 Subject: Pass LC_ALL=C when extracting locale-dependent information on POSIX --- libbuild2/diagnostics.cxx | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'libbuild2/diagnostics.cxx') diff --git a/libbuild2/diagnostics.cxx b/libbuild2/diagnostics.cxx index 0a01457..ee4651d 100644 --- a/libbuild2/diagnostics.cxx +++ b/libbuild2/diagnostics.cxx @@ -49,14 +49,32 @@ namespace build2 void print_process (const char* const* args, size_t n) { - diag_record r (text); - print_process (r, args, n); + diag_record dr (text); + print_process (dr, args, n); } void - print_process (diag_record& r, const char* const* args, size_t n) + print_process (diag_record& dr, + const char* const* args, size_t n) { - r << butl::process_args {args, n}; + dr << butl::process_args {args, n}; + } + + void + print_process (const process_env& pe, const char* const* args, size_t n) + { + diag_record dr (text); + print_process (dr, pe, args, n); + } + + void + print_process (diag_record& dr, + const process_env& pe, const char* const* args, size_t n) + { + if (pe.env ()) + dr << pe << ' '; + + dr << butl::process_args {args, n}; } // Diagnostics stack. -- cgit v1.1