BorisSchaeling / boost-process

Boost.Process is a library to manage system processes
Boost Software License 1.0
32 stars 20 forks source link

Confusing docs for set_args #18

Open alamaison opened 8 years ago

alamaison commented 8 years ago

The docs for set_args say 'The first argument specifies the executable to start unless run_exe is used'. It's not clear from this if the first argument you pass is argv[0] or argv[1] when also using run_exe.

It turns out on Windows that the first argument in argv[0], rather than what you passed to run_exe. It looks like this is different from the POSIX behaviour:

    explicit run_exe_(const std::string &s) : s_(s), cmd_line_(new char*[2])
    {
        cmd_line_[0] = const_cast<char*>(s_.c_str());
        cmd_line_[1] = 0;
    }