1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 08:55:18 +03:00

test-escape: Add tests for escaping bogus UTF-8 sequences

(cherry picked from commit 582843ee37)
(cherry picked from commit c4e7cf2bd7)
(cherry picked from commit dec5e2e7b5)
This commit is contained in:
msizanoen1 2023-03-01 21:48:08 +07:00 committed by Zbigniew Jędrzejewski-Szmek
parent dfa043ae1f
commit 11ecf66646

View File

@ -196,6 +196,10 @@ TEST(shell_maybe_quote) {
test_shell_maybe_quote_one("głąb\002\003rząd", 0, "\"głąb\\002\\003rząd\"");
test_shell_maybe_quote_one("głąb\002\003rząd", SHELL_ESCAPE_POSIX, "$'głąb\\002\\003rząd'");
/* Bogus UTF-8 strings */
test_shell_maybe_quote_one("\250\350", 0, "\"\\250\\350\"");
test_shell_maybe_quote_one("\250\350", SHELL_ESCAPE_POSIX, "$'\\250\\350'");
}
static void test_quote_command_line_one(char **argv, const char *expected) {