]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-util: simplify final path for find_executable() 33810/head
authorMike Yuan <me@yhndnzj.com>
Mon, 22 Jul 2024 20:17:24 +0000 (22:17 +0200)
committerMike Yuan <me@yhndnzj.com>
Tue, 23 Jul 2024 16:48:15 +0000 (18:48 +0200)
Currently, systemd-run ./test.sh would set Description=
to $PWD/./test.sh. This is quite ugly.

src/basic/path-util.c

index 0b4d7b6cf779129240aa02dba45e0bfde9e0fc0b..78ba10ed8093d1779eb69e70d4e09a29ac584d3c 100644 (file)
@@ -669,6 +669,8 @@ static int find_executable_impl(const char *name, const char *root, char **ret_f
                 r = path_make_absolute_cwd(name, ret_filename);
                 if (r < 0)
                         return r;
+
+                path_simplify(*ret_filename);
         }
 
         if (ret_fd)