From d02d602090b81e301fcf773d737e0423f5966bf0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 13 Mar 2017 16:17:47 -0700 Subject: [PATCH] System::cmd_execute_and_capture_output() now redirects std::err to std::out --- toolsrc/src/commands_portsdiff.cpp | 2 +- toolsrc/src/vcpkg_System.cpp | 2 +- toolsrc/src/vcpkg_paths.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 4d5a589f6..dea95f56c 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -57,7 +57,7 @@ namespace vcpkg::Commands::PortsDiff { static const std::string VALID_COMMIT_OUTPUT = "commit\n"; - const std::wstring cmd = Strings::wformat(LR"("%s" cat-file -t %s 2>NUL)", git_exe.native(), git_commit_id); + const std::wstring cmd = Strings::wformat(LR"("%s" cat-file -t %s)", git_exe.native(), git_commit_id); const System::exit_code_and_output output = System::cmd_execute_and_capture_output(cmd); Checks::check_exit(output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id)); } diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index 472f8450f..b872fe2fd 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -103,7 +103,7 @@ namespace vcpkg::System // Flush stdout before launching external process fflush(stdout); - const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line); + const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s 2>&1")###", cmd_line); std::string output; char buf[1024]; diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp index cf8161353..84c99c806 100644 --- a/toolsrc/src/vcpkg_paths.cpp +++ b/toolsrc/src/vcpkg_paths.cpp @@ -12,7 +12,7 @@ namespace vcpkg { static const std::regex re(R"###((\d+)\.(\d+)\.(\d+))###"); - auto rc = System::cmd_execute_and_capture_output(Strings::wformat(LR"(%s 2>&1)", version_cmd)); + auto rc = System::cmd_execute_and_capture_output(Strings::wformat(LR"(%s)", version_cmd)); if (rc.exit_code != 0) { return false; @@ -55,7 +55,7 @@ namespace vcpkg static std::vector find_from_PATH(const std::wstring& name) { - const std::wstring cmd = Strings::wformat(L"where.exe %s 2>&1", name); + const std::wstring cmd = Strings::wformat(L"where.exe %s", name); auto out = System::cmd_execute_and_capture_output(cmd); if (out.exit_code != 0) {