From b0de6a63270998662cc069cc2ca1579776bb28df Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Sat, 29 Aug 2009 16:50:43 +0200 Subject: [PATCH] util_delete_path(): handle multiple leading slashes --- libudev/libudev-util-private.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.39.5