mirror of
https://github.com/nushell/nushell
synced 2024-12-25 12:33:17 +00:00
Fix comment typos in run_external.rs (#14229)
This commit is contained in:
parent
d575fd1c3a
commit
3e39fae6e1
1 changed files with 3 additions and 3 deletions
|
@ -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 '%'"
|
||||
|
|
Loading…
Reference in a new issue