From: Florian Zumbiehl Date: Sat, 29 Aug 2009 14:50:43 +0000 (+0200) Subject: util_delete_path(): handle multiple leading slashes X-Git-Tag: 174~806 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0de6a63270998662cc069cc2ca1579776bb28df;p=systemd util_delete_path(): handle multiple leading slashes --- diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c index c8656715..042b7119 100644 --- a/libudev/libudev-util-private.c +++ b/libudev/libudev-util-private.c @@ -64,6 +64,9 @@ int util_delete_path(struct udev *udev, const char *path) char *pos; int retval; + if (path[0] == '/') + while(path[1] == '/') + path++; util_strscpy(p, sizeof(p), path); pos = strrchr(p, '/'); if (pos == p || pos == NULL)