mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 07:12:44 +00:00
Merge pull request #5350 from cakebaker/echo_no_new_line
echo: don't output "\n" if "\c" is encountered
This commit is contained in:
commit
9e9701974e
2 changed files with 2 additions and 2 deletions
|
@ -175,7 +175,7 @@ fn execute(no_newline: bool, escaped: bool, free: &[String]) -> io::Result<()> {
|
||||||
}
|
}
|
||||||
if escaped {
|
if escaped {
|
||||||
if print_escaped(input, &mut output)?.is_break() {
|
if print_escaped(input, &mut output)?.is_break() {
|
||||||
break;
|
return Ok(());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
write!(output, "{input}")?;
|
write!(output, "{input}")?;
|
||||||
|
|
|
@ -122,7 +122,7 @@ fn test_escape_no_further_output() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.args(&["-e", "a\\cb", "c"])
|
.args(&["-e", "a\\cb", "c"])
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_only("a\n");
|
.stdout_only("a");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue