]> wimlib.net Git - wimlib/blobdiff - src/paths.c
Add ADS entry workaround
[wimlib] / src / paths.c
index 85fb6bc082130656713e32f46ba84884880616ad..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;