From 32a8f700a4acd601c6bac89e871d2e9e145f4adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?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 3bde1d1e01..efeca13594 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -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;