summaryrefslogtreecommitdiff
path: root/src/xdg-autostart-generator
diff options
context:
space:
mode:
authorDavid Edmundson <kde@davidedmundson.co.uk>2022-10-11 11:18:13 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2022-10-17 16:42:39 +0200
commit9739bcfd85119d20867fb2f948807edde8279661 (patch)
tree7c715b7ee8b103a42709396585861c571d8c884f /src/xdg-autostart-generator
parentf87338fa2680ca8c59830b50202eb5a3f023c070 (diff)
downloadsystemd-9739bcfd85119d20867fb2f948807edde8279661.tar.gz
xdg-autostart-service: Add comments to tilde expansion, use path_join()
Follow-ups for https://github.com/systemd/systemd/pull/24658
Diffstat (limited to 'src/xdg-autostart-generator')
-rw-r--r--src/xdg-autostart-generator/xdg-autostart-service.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c
index 5aa74fe37a..3905d4bfe1 100644
--- a/src/xdg-autostart-generator/xdg-autostart-service.c
+++ b/src/xdg-autostart-generator/xdg-autostart-service.c
@@ -443,7 +443,10 @@ int xdg_autostart_format_exec_start(
return log_oom();
/*
- * Expand ~ if it comes at the beginning of an argument to form a path
+ * Expand ~ if it comes at the beginning of an argument to form a path.
+ *
+ * The specification does not mandate this, but we do it anyway for compatibility with
+ * older KDE code, which supported a more shell-like syntax for users making custom entries.
*/
if (percent[0] == '~' && (isempty(percent + 1) || path_is_absolute(percent + 1))) {
_cleanup_free_ char *home = NULL;
@@ -452,7 +455,7 @@ int xdg_autostart_format_exec_start(
if (r < 0)
return r;
- tilde_expanded = strjoin(home, &percent[1]);
+ tilde_expanded = path_join(home, &percent[1]);
if (!tilde_expanded)
return log_oom();
free_and_replace(exec_split[n++], tilde_expanded);