]> wimlib.net Git - wimlib/blobdiff - src/util.c
NTFS capture updates
[wimlib] / src / util.c
index b2d26256a5c60d82f78747aa12db9ee3e456dfb0..8f4e0c0be53756db28ef2974d43de4b1f08b8b3e 100644 (file)
@@ -127,6 +127,8 @@ static const char *error_strings[] = {
                = "Tried to add an image with a name that is already in use",
        [WIMLIB_ERR_INTEGRITY] 
                = "The WIM failed an integrity check",
+       [WIMLIB_ERR_INVALID_CAPTURE_CONFIG]
+               = "The capture configuration string was invalid",
        [WIMLIB_ERR_INVALID_CHUNK_SIZE] 
                = "The WIM is compressed but does not have a chunk "
                        "size of 32768",
@@ -427,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--;