summaryrefslogtreecommitdiffstats
path: root/src/xdg-autostart-generator/test-xdg-autostart.c
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-03-24 13:00:59 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-03-25 06:50:41 +0100
commitc2b42ec413aefe05681c20f294662cab11d89320 (patch)
tree41ad542756d03d4d543991d47eea6d2fe38838db /src/xdg-autostart-generator/test-xdg-autostart.c
parentefi-loader: drop harmful assertion (diff)
downloadsystemd-c2b42ec413aefe05681c20f294662cab11d89320.tar.xz
systemd-c2b42ec413aefe05681c20f294662cab11d89320.zip
xdg-autostart-service: Fix binary escaping and simplify code a bit
Instead of escaping each component separately, we can instead use quote_command_line. Doing so simplifies the code and fixes an issue where spaces inside the executable name were not escaped. Co-Authored-By: David Edmundson <kde@davidedmundson.co.uk>
Diffstat (limited to 'src/xdg-autostart-generator/test-xdg-autostart.c')
-rw-r--r--src/xdg-autostart-generator/test-xdg-autostart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xdg-autostart-generator/test-xdg-autostart.c b/src/xdg-autostart-generator/test-xdg-autostart.c
index 841a5606f6..a357cf50fe 100644
--- a/src/xdg-autostart-generator/test-xdg-autostart.c
+++ b/src/xdg-autostart-generator/test-xdg-autostart.c
@@ -25,13 +25,13 @@ static void test_xdg_format_exec_start_one(const char *exec, const char *expecte
}
TEST(xdg_format_exec_start) {
- test_xdg_format_exec_start_one("/bin/sleep 100", "/bin/sleep \"100\"");
+ test_xdg_format_exec_start_one("/bin/sleep 100", "/bin/sleep 100");
/* All standardised % identifiers are stripped. */
test_xdg_format_exec_start_one("/bin/sleep %f \"%F\" %u %U %d %D\t%n %N %i %c %k %v %m", "/bin/sleep");
/* Unknown % identifier currently remain, but are escaped. */
- test_xdg_format_exec_start_one("/bin/sleep %X \"%Y\"", "/bin/sleep \"%%X\" \"%%Y\"");
+ test_xdg_format_exec_start_one("/bin/sleep %X \"%Y\"", "/bin/sleep %%X %%Y");
test_xdg_format_exec_start_one("/bin/sleep \";\\\"\"", "/bin/sleep \";\\\"\"");
}