Skip to content

Commit 635c226

Browse files
Konvicka FilipKlemens Morgenstern
authored andcommitted
Fix: corrected empty double quotes being added to cmd.exe /c on Windows with bp::shell and bp::args (caused by PR #256)
1 parent 773ac74 commit 635c226

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/boost/process/v1/detail/windows/basic_cmd.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ struct exe_cmd_init : handler_base_ext
162162
}
163163
static exe_cmd_init<Char> exe_args_shell(string_type && exe, std::vector<string_type> && args)
164164
{
165-
std::vector<string_type> args_ = {c_arg(Char()), std::move(exe)};
165+
std::vector<string_type> args_ = {c_arg(Char())};
166+
if (!exe.empty())
167+
args_.emplace_back(std::move(exe));
166168
args_.insert(args_.end(), std::make_move_iterator(args.begin()), std::make_move_iterator(args.end()));
167169
string_type sh = get_shell(Char());
168170

0 commit comments

Comments
 (0)