mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
echo: don't output "\n" if "\c" is encountered
This commit is contained in:
@@ -175,7 +175,7 @@ fn execute(no_newline: bool, escaped: bool, free: &[String]) -> io::Result<()> {
|
||||
}
|
||||
if escaped {
|
||||
if print_escaped(input, &mut output)?.is_break() {
|
||||
break;
|
||||
return Ok(());
|
||||
}
|
||||
} else {
|
||||
write!(output, "{input}")?;
|
||||
|
||||
@@ -122,7 +122,7 @@ fn test_escape_no_further_output() {
|
||||
new_ucmd!()
|
||||
.args(&["-e", "a\\cb", "c"])
|
||||
.succeeds()
|
||||
.stdout_only("a\n");
|
||||
.stdout_only("a");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user