]> git.sesse.net Git - vlc/commitdiff
text: make_path returns (null) for Win32 if hostname starts with blank
authorJohn Freed <okvlc@johnfreed.com>
Sun, 18 Mar 2012 21:29:27 +0000 (22:29 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 22 Mar 2012 16:41:41 +0000 (17:41 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
src/text/strings.c

index 7b709dfdc207a2b96b49ca4b4c5d05f67e8f904c..dc7d1f7a854f822142199183da3417c69d52bc99 100644 (file)
@@ -1223,6 +1223,9 @@ char *make_path (const char *url)
         if (!strncasecmp (path, "localhost/", 10))
             return memmove (path, path + 9, strlen (path + 9) + 1);
 #else
+        /* cannot start with a space */
+        if (*path == ' ')
+            goto out;
         for (char *p = strchr (path, '/'); p; p = strchr (p + 1, '/'))
             *p = '\\';