mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #5828 from samueltardieu/printf-double-quote
printf: output of double-quote should not be escaped
This commit is contained in:
commit
5b860cb428
2 changed files with 6 additions and 0 deletions
|
@ -108,6 +108,7 @@ pub fn parse_escape_code(rest: &mut &[u8]) -> EscapedChar {
|
||||||
*rest = new_rest;
|
*rest = new_rest;
|
||||||
match c {
|
match c {
|
||||||
b'\\' => EscapedChar::Byte(b'\\'),
|
b'\\' => EscapedChar::Byte(b'\\'),
|
||||||
|
b'"' => EscapedChar::Byte(b'"'),
|
||||||
b'a' => EscapedChar::Byte(b'\x07'),
|
b'a' => EscapedChar::Byte(b'\x07'),
|
||||||
b'b' => EscapedChar::Byte(b'\x08'),
|
b'b' => EscapedChar::Byte(b'\x08'),
|
||||||
b'c' => EscapedChar::End,
|
b'c' => EscapedChar::End,
|
||||||
|
|
|
@ -36,6 +36,11 @@ fn escaped_slash() {
|
||||||
.stdout_only("hello\\ world");
|
.stdout_only("hello\\ world");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unescaped_double_quote() {
|
||||||
|
new_ucmd!().args(&["\\\""]).succeeds().stdout_only("\"");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn escaped_hex() {
|
fn escaped_hex() {
|
||||||
new_ucmd!().args(&["\\x41"]).succeeds().stdout_only("A");
|
new_ucmd!().args(&["\\x41"]).succeeds().stdout_only("A");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue