[vlc-devel] [PATCH 1/3] text: make_path returns (null) if hostname starts with blank

John Freed okvlc at johnfreed.com
Thu Mar 15 21:54:27 CET 2012


This makes Win32 conform to Linux behavior, as well as RFCs. Valid UNC paths still work.
---
 src/text/strings.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/text/strings.c b/src/text/strings.c
index c1a7493..45a5d62 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -1215,6 +1215,9 @@ char *make_path (const char *url)
 
     if (schemelen == 4 && !strncasecmp (url, "file", 4))
     {
+        /* cannot start with a space */
+        if (*path == ' ')
+            goto out;
 #if (!defined (WIN32) && !defined (__OS2__)) || defined (UNDER_CE)
         /* Leading slash => local path */
         if (*path == '/')
-- 
1.7.7.6




More information about the vlc-devel mailing list