File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 102
102
# define BUFSIZE 2048
103
103
104
104
#ifdef _WIN32
105
- std::wstring process_windows_args (const std::vector<std::string> commandvec)
105
+ // / This function prepares a single wide string for the windows command
106
+ // / line.
107
+ // / \param commandvec: A vector of strings that contain the command and
108
+ // / arguments to the command.
109
+ // / \returns A single wide string of the command appropriate for windows
110
+ static std::wstring
111
+ prepare_windows_command_line (const std::vector<std::string> &commandvec)
106
112
{
107
113
std::wstring result = widen (commandvec[0 ]);
108
114
for (int i = 1 ; i < commandvec.size (); i++)
@@ -114,7 +120,7 @@ std::wstring process_windows_args(const std::vector<std::string> commandvec)
114
120
}
115
121
#endif
116
122
117
- piped_processt::piped_processt (const std::vector<std::string> commandvec)
123
+ piped_processt::piped_processt (const std::vector<std::string> & commandvec)
118
124
{
119
125
# ifdef _WIN32
120
126
// Security attributes for pipe creation
@@ -204,7 +210,7 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
204
210
start_info.hStdOutput = child_std_OUT_Wr;
205
211
start_info.hStdInput = child_std_IN_Rd;
206
212
start_info.dwFlags |= STARTF_USESTDHANDLES;
207
- const std::wstring cmdline = process_windows_args (commandvec);
213
+ const std::wstring cmdline = prepare_windows_command_line (commandvec);
208
214
// Note that we do NOT free this since it becomes part of the child
209
215
// and causes heap corruption in Windows if we free!
210
216
const BOOL success = CreateProcessW (
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class piped_processt
78
78
// / Initiate a new subprocess with pipes supporting communication
79
79
// / between the parent (this process) and the child.
80
80
// / \param commandvec The command and arguments to create the process
81
- explicit piped_processt (const std::vector<std::string> commandvec);
81
+ explicit piped_processt (const std::vector<std::string> & commandvec);
82
82
83
83
// Deleted due to declaring an explicit destructor and not wanting copy
84
84
// constructors to be implemented.
You can’t perform that action at this time.
0 commit comments