From: Zbigniew Jędrzejewski-Szmek Date: Thu, 23 Nov 2017 12:02:21 +0000 (+0100) Subject: util-lib: kill duplicate slashes in lookup paths X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fecdb9416d94efbbc947cd8ee376d78d33d090c4;p=elogind.git util-lib: kill duplicate slashes in lookup paths Since we're munging the array anyway, we can make the output a bit nicer too. --- diff --git a/src/basic/path-util.c b/src/basic/path-util.c index fa17fc034..83751716a 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -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;