correctly escape pipe in windows/cmd.exe (#3489)

* correctly escape pipe in windows/cmd.exe

* add some comments, take out debug line
This commit is contained in:
Darren Schroeder
2021-05-25 09:19:45 -05:00
committed by GitHub
parent ac38ee82f4
commit 65ee7aa372

View File

@ -150,7 +150,9 @@ fn spawn(
process.arg(&command.name);
for arg in args {
// Clean the args before we use them:
let arg = arg.replace("|", "\\|");
// https://stackoverflow.com/questions/1200235/how-to-pass-a-quoted-pipe-character-to-cmd-exe
// cmd.exe needs to have a caret to escape a pipe
let arg = arg.replace("|", "^|");
process.arg(&arg);
}
process