From fecdb9416d94efbbc947cd8ee376d78d33d090c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 23 Nov 2017 13:02:21 +0100 Subject: [PATCH] util-lib: kill duplicate slashes in lookup paths Since we're munging the array anyway, we can make the output a bit nicer too. --- src/basic/path-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.30.2