diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2019-12-05 15:12:59 +0900 |
commit | b8cf34c691623e4ec329053cbbf68522a855882d (patch) | |
tree | 34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/process/detail/posix/basic_cmd.hpp | |
parent | 3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff) | |
download | boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2 boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip |
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/process/detail/posix/basic_cmd.hpp')
-rw-r--r-- | boost/process/detail/posix/basic_cmd.hpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/boost/process/detail/posix/basic_cmd.hpp b/boost/process/detail/posix/basic_cmd.hpp index eefcc5c53f..326e30dc0b 100644 --- a/boost/process/detail/posix/basic_cmd.hpp +++ b/boost/process/detail/posix/basic_cmd.hpp @@ -118,12 +118,8 @@ struct exe_cmd_init<char> : boost::process::detail::api::handler_base_ext else exec.exe = &exe.front(); - - if (!args.empty()) - { - cmd_impl = make_cmd(); - exec.cmd_line = cmd_impl.data(); - } + cmd_impl = make_cmd(); + exec.cmd_line = cmd_impl.data(); } static exe_cmd_init exe_args(std::string && exe, std::vector<std::string> && args) {return exe_cmd_init(std::move(exe), std::move(args));} static exe_cmd_init cmd (std::string && cmd) @@ -163,8 +159,10 @@ std::vector<char*> exe_cmd_init<char>::make_cmd() if (!exe.empty()) vec.push_back(&exe.front()); - for (auto & v : args) - vec.push_back(&v.front()); + if (!args.empty()) { + for (auto & v : args) + vec.push_back(&v.front()); + } vec.push_back(nullptr); |