diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-03-15 03:54:12 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-03-15 03:54:12 +0100 |
commit | 27d4bf1817259873b0a1e118d03978f0d2f2595e (patch) | |
tree | 7ff05ea4f36bfb27badce6bb9d156e931d996599 /udev_utils_file.c | |
parent | fbda4babec842382d704eb41b2040d73ad995886 (diff) |
restore overwritten symlinks when the device goes away
Diffstat (limited to 'udev_utils_file.c')
-rw-r--r-- | udev_utils_file.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/udev_utils_file.c b/udev_utils_file.c index 9bf60696d9..e4d5802ff8 100644 --- a/udev_utils_file.c +++ b/udev_utils_file.c @@ -65,6 +65,9 @@ int delete_path(const char *path) strcpy (p, path); pos = strrchr(p, '/'); + if (pos == p || pos == NULL) + return 0; + while (1) { *pos = '\0'; pos = strrchr(p, '/'); |