chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Thu, 23 Nov 2017 12:02:21 +0000 (13:02 +0100)
Since we're munging the array anyway, we can make the output a bit
nicer too.

src/basic/path-util.c

index fa17fc0348cfa9189de1a6e31df16b6f75596940..83751716a48a592f95982490a32cfa3729164d6b 100644 (file)
@@ -225,8 +225,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;