diff --git a/src/uucore/src/lib/features/format/escape.rs b/src/uucore/src/lib/features/format/escape.rs index d20da3e7e3..9420507f3e 100644 --- a/src/uucore/src/lib/features/format/escape.rs +++ b/src/uucore/src/lib/features/format/escape.rs @@ -108,6 +108,7 @@ pub fn parse_escape_code(rest: &mut &[u8]) -> EscapedChar { *rest = new_rest; match c { b'\\' => EscapedChar::Byte(b'\\'), + b'"' => EscapedChar::Byte(b'"'), b'a' => EscapedChar::Byte(b'\x07'), b'b' => EscapedChar::Byte(b'\x08'), b'c' => EscapedChar::End, diff --git a/tests/by-util/test_printf.rs b/tests/by-util/test_printf.rs index 48fc1e6ace..a288d7c084 100644 --- a/tests/by-util/test_printf.rs +++ b/tests/by-util/test_printf.rs @@ -36,6 +36,11 @@ fn escaped_slash() { .stdout_only("hello\\ world"); } +#[test] +fn unescaped_double_quote() { + new_ucmd!().args(&["\\\""]).succeeds().stdout_only("\""); +} + #[test] fn escaped_hex() { new_ucmd!().args(&["\\x41"]).succeeds().stdout_only("A");