find: -printf: test octal escape before a multibyte char

Regression test for the panic fixed in #720/#723: a `\NNN` octal escape
immediately followed by a multibyte character (`\0€`) used to slice the
format string mid-char and abort. Assert `-printf` emits the escape byte
and the following character intact.
This commit is contained in:
weili
2026-06-10 07:45:25 +02:00
committed by Sylvestre Ledru
parent 782744f35c
commit 5992901805
+9
View File
@@ -510,6 +510,15 @@ fn find_printf() {
);
}
#[test]
fn find_printf_octal_escape_before_multibyte_char() {
ucmd()
.args(&["./test_data/simple", "-maxdepth", "0", "-printf", "\\0€\\n"])
.succeeds()
.no_stderr()
.stdout_only("\0\n");
}
#[cfg(unix)]
#[test]
fn find_perm() {