]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: kill duplicate slashes in lookup paths
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 23 Nov 2017 12:02:21 +0000 (13:02 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 6 Dec 2017 09:18:27 +0000 (10:18 +0100)
Since we're munging the array anyway, we can make the output a bit
nicer too.

src/basic/path-util.c

index 3bde1d1e01bf3ddae470a5f9b2520e95d8965040..efeca13594d5487de3cd02bbffcb054d6154dd66 100644 (file)
@@ -223,8 +223,8 @@ int path_strv_make_absolute_cwd(char **l) {
                 if (r < 0)
                         return r;
 
-                free(*s);
-                *s = t;
+                path_kill_slashes(t);
+                free_and_replace(*s, t);
         }
 
         return 0;