]> err.no Git - systemd/commitdiff
util_delete_path(): handle multiple leading slashes
authorFlorian Zumbiehl <florz@florz.de>
Sat, 29 Aug 2009 14:50:43 +0000 (16:50 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sat, 29 Aug 2009 14:50:43 +0000 (16:50 +0200)
libudev/libudev-util-private.c

index c86567159eaf98a5886b67371bb1cb152bf98419..042b711928add19cff5ab34145d9f519e280e89e 100644 (file)
@@ -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)