Fix comment typos in run_external.rs (#14229)

This commit is contained in:
Jan Klass 2024-11-01 17:55:21 +01:00 committed by GitHub
parent d575fd1c3a
commit 3e39fae6e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,7 +69,7 @@ impl Command for External {
};
// Find the absolute path to the executable. On Windows, set the
// executable to "cmd.exe" if it's is a CMD internal command. If the
// executable to "cmd.exe" if it's a CMD internal command. If the
// command is not found, display a helpful error message.
let executable = if cfg!(windows) && is_cmd_internal_command(&name_str) {
PathBuf::from("cmd.exe")
@ -114,7 +114,7 @@ impl Command for External {
command.args(args.into_iter().map(|s| s.item));
// Configure stdout and stderr. If both are set to `OutDest::Pipe`,
// we'll setup a pipe that merge two streams into one.
// we'll setup a pipe that merges two streams into one.
let stdout = stack.stdout();
let stderr = stack.stderr();
let merged_stream = if matches!(stdout, OutDest::Pipe) && matches!(stderr, OutDest::Pipe) {
@ -534,7 +534,7 @@ fn escape_cmd_argument(arg: &Spanned<OsString>) -> Result<Cow<'_, OsStr>, ShellE
let Spanned { item: arg, span } = arg;
let bytes = arg.as_encoded_bytes();
if bytes.iter().any(|b| matches!(b, b'\r' | b'\n' | b'%')) {
// \r and \n trunacte the rest of the arguments and % can expand environment variables
// \r and \n truncate the rest of the arguments and % can expand environment variables
Err(ShellError::ExternalCommand {
label:
"Arguments to CMD internal commands cannot contain new lines or percent signs '%'"