mirror of
https://github.com/rust-lang/cargo
synced 2024-08-25 02:25:46 +00:00
test: minimal shell quote supoort for cargo-test-support
This commit is contained in:
parent
1f6c6bd5e7
commit
be31989a43
|
@ -1637,8 +1637,12 @@ impl ChannelChanger for cargo::util::ProcessBuilder {
|
|||
}
|
||||
|
||||
fn split_and_add_args(p: &mut ProcessBuilder, s: &str) {
|
||||
for arg in s.split_whitespace() {
|
||||
if arg.contains('"') || arg.contains('\'') {
|
||||
for mut arg in s.split_whitespace() {
|
||||
if (arg.starts_with('"') && arg.ends_with('"'))
|
||||
|| (arg.starts_with('\'') && arg.ends_with('\''))
|
||||
{
|
||||
arg = &arg[1..(arg.len() - 1).max(1)];
|
||||
} else if arg.contains(&['"', '\''][..]) {
|
||||
panic!("shell-style argument parsing is not supported")
|
||||
}
|
||||
p.arg(arg);
|
||||
|
|
Loading…
Reference in a new issue