]> wimlib.net Git - wimlib/blobdiff - src/paths.c
Merge experimental LZX compressor
[wimlib] / src / paths.c
index 9becb2128185d6dddc06c5251332c9ca4bf53bca..23e8205054e6fa7728b7ae431c65d9dc564889bc 100644 (file)
@@ -64,14 +64,15 @@ path_basename_with_len(const tchar *path, size_t len)
 
 /*
  * Returns a pointer to the part of @path following the first colon in the last
- * path component, or NULL if the last path component does not contain a colon.
+ * path component, or NULL if the last path component does not contain a colon
+ * or has no characters following the first colon.
  */
 const tchar *
 path_stream_name(const tchar *path)
 {
        const tchar *base = path_basename(path);
        const tchar *stream_name = tstrchr(base, T(':'));
-       if (!stream_name)
+       if (stream_name == NULL || *(stream_name + 1) == T('\0'))
                return NULL;
        else
                return stream_name + 1;
@@ -87,7 +88,7 @@ canonicalize_fs_path(const tchar *fs_path)
        return TSTRDUP(fs_path);
 }
 
-/* 
+/*
  * canonicalize_wim_path - Given a user-provided path to a file within a WIM
  * image, translate it into a "canonical" path.
  *