]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-escape.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / test / test-escape.c
index 181d7db5b4ca3d2010e0dc920bada0a7317ba7fc..aa05520abd6dd837a973baf4a3b933e141e0ebb3 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -69,6 +70,14 @@ static void test_cunescape(void) {
 
         assert_se(cunescape("\\073", 0, &unescaped) >= 0);
         assert_se(streq_ptr(unescaped, ";"));
+        unescaped = mfree(unescaped);
+
+        assert_se(cunescape("A=A\\\\x0aB", 0, &unescaped) >= 0);
+        assert_se(streq_ptr(unescaped, "A=A\\x0aB"));
+        unescaped = mfree(unescaped);
+
+        assert_se(cunescape("A=A\\\\x0aB", UNESCAPE_RELAX, &unescaped) >= 0);
+        assert_se(streq_ptr(unescaped, "A=A\\x0aB"));
 }
 
 static void test_shell_escape_one(const char *s, const char *bad, const char *expected) {