util_delete_path(): handle multiple leading slashes

This commit is contained in:
Florian Zumbiehl
2009-08-29 16:50:43 +02:00
committed by Kay Sievers
parent 28da1a6186
commit b0de6a6327
+3
View 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)