Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion include/boost/process/detail/windows/basic_cmd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ struct exe_cmd_init : handler_base_ext
return exe_cmd_init<Char>(std::move(sh), std::move(args_));
}

static std:: string get_shell(char) {return shell(). string(codecvt()); }
static std:: string get_shell(char) {
std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
return converter.to_bytes(shell().wstring(codecvt()));
}
static std::wstring get_shell(wchar_t) {return shell().wstring(codecvt());}

static exe_cmd_init<Char> cmd_shell(string_type&& cmd)
Expand Down
4 changes: 2 additions & 2 deletions include/boost/process/detail/windows/shell_path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inline boost::process::filesystem::path shell_path()
throw_last_error("GetSystemDirectory() failed");

boost::process::filesystem::path p = sysdir;
return p / "cmd.exe";
return p += L"\\cmd.exe";
}

inline boost::process::filesystem::path shell_path(std::error_code &ec) noexcept
Expand All @@ -43,7 +43,7 @@ inline boost::process::filesystem::path shell_path(std::error_code &ec) noexcept
{
ec.clear();
p = sysdir;
p /= "cmd.exe";
p += L"\\cmd.exe";
}
return p;
}
Expand Down