From 69005f8c600acadc6a37d195b584d4f4363d68d3 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 6 Jan 2017 17:38:13 +0100 Subject: [PATCH] builtin_test: Produce wide output to stderr GNU systems don't allow mixing narrow and wide IO, so some of these messages were lost since 1621fa43d849326fe956d460e982253488dbf58e. stderr is also the more logical place for error output to end up. Fixes #3704. --- src/builtin_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/builtin_test.cpp b/src/builtin_test.cpp index 6b457b994..bac2d9381 100644 --- a/src/builtin_test.cpp +++ b/src/builtin_test.cpp @@ -810,11 +810,11 @@ int builtin_test(parser_t &parser, io_streams_t &streams, wchar_t **argv) { expression *expr = test_parser::parse_args(args, err, program_name); if (!expr) { #if 0 - printf("Oops! test was given args:\n"); + fwprintf(stderr, L"Oops! test was given args:\n"); for (size_t i=0; i < argc; i++) { - printf("\t%ls\n", args.at(i).c_str()); + fwprintf(stderr, L"\t%ls\n", args.at(i).c_str()); } - printf("and returned parse error: %ls\n", err.c_str()); + fwprintf(stderr, L"and returned parse error: %ls\n", err.c_str()); #endif streams.err.append(err); return BUILTIN_TEST_FAIL; @@ -823,9 +823,9 @@ int builtin_test(parser_t &parser, io_streams_t &streams, wchar_t **argv) { wcstring_list_t eval_errors; bool result = expr->evaluate(eval_errors); if (!eval_errors.empty() && !should_suppress_stderr_for_tests()) { - printf("test returned eval errors:\n"); + fwprintf(stderr, L"test returned eval errors:\n"); for (size_t i = 0; i < eval_errors.size(); i++) { - printf("\t%ls\n", eval_errors.at(i).c_str()); + fwprintf(stderr, L"\t%ls\n", eval_errors.at(i).c_str()); } } delete expr;