From b8cf34c691623e4ec329053cbbf68522a855882d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 5 Dec 2019 15:12:59 +0900 Subject: Imported Upstream version 1.67.0 --- boost/process/detail/posix/basic_cmd.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'boost/process/detail/posix/basic_cmd.hpp') 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 : 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 && 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 exe_cmd_init::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); -- cgit v1.2.3