Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAlways quote program name in Command::spawn on Windows #42436
Conversation
This comment has been minimized.
This comment has been minimized.
|
Alternatively, we could pass the binary name as the first parameter to |
alexcrichton
self-assigned this
Jun 5, 2017
This comment has been minimized.
This comment has been minimized.
|
Looks good to me, thanks @ollie27! Would it be possible to add a test for this? Passing the binary name explicitly sounds fine as well, so it sounds like we should just do both things? |
carols10cents
added
the
S-waiting-on-author
label
Jun 5, 2017
This comment has been minimized.
This comment has been minimized.
|
It looks like using the first parameter behaves very differently:
I guess I'll try to write a run-make test for this. |
This comment has been minimized.
This comment has been minimized.
|
Right, I've added a run-make test. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
So I just did a quick test and when I passed a verbatim path as the first parameter to |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jun 6, 2017
This comment has been minimized.
This comment has been minimized.
|
|
ollie27 commentedJun 4, 2017
CreateProcesswill interpret args as part of the binary name if itdoesn't find the binary using just the unquoted name. For example if
foo.exedoesn't exist,Command::new("foo").arg("bar").spawn()willtry to launch
foo bar.exewhich is clearly not desired.