]> wimlib.net Git - wimlib/blobdiff - src/util.c
NTFS capture updates
[wimlib] / src / util.c
index fdb0c850dc7be34e99d5a432372180e54dfece39..8f4e0c0be53756db28ef2974d43de4b1f08b8b3e 100644 (file)
@@ -429,8 +429,13 @@ const char *path_basename(const char *path)
        p--;
 
        /* Trailing slashes. */
-       while ((p != path - 1) && *p == '/')
+       while (1) {
+               if (p == path - 1)
+                       return "";
+               if (*p != '/')
+                       break;
                p--;
+       }
 
        while ((p != path - 1) && *p != '/')
                p--;