]> git.sesse.net Git - vlc/commitdiff
Fix user:pass parsing if protocol is not given.
authorJérome Decoodt <djc@videolan.org>
Sun, 24 Jul 2005 14:39:14 +0000 (14:39 +0000)
committerJérome Decoodt <djc@videolan.org>
Sun, 24 Jul 2005 14:39:14 +0000 (14:39 +0000)
Not tested with all calls (only http access module)

include/network.h

index e2399278f1b2e8395076ef88866948c568f87ae6..b5dacef0b0899dcbc27e07b1d79f332bebd9bef9 100644 (file)
@@ -112,25 +112,24 @@ static inline void vlc_UrlParse( vlc_url_t *url, const char *psz_url,
         if( p[1] == '/' )
             p += 2;
         url->psz_protocol = psz_parse;
-
         psz_parse = p;
-        p = strchr( psz_parse, '@' );
-        if( p != NULL )
-        {
-            /* We have a login */
-            url->psz_username = psz_parse;
-            *p++ = '\0';
-
-            psz_parse = strchr( psz_parse, ':' );
-            if( psz_parse != NULL )
-            {
-                /* We have a password */
-                *psz_parse++ = '\0';
-                url->psz_password = psz_parse;
-            }
+    }
+    p = strchr( psz_parse, '@' );
+    if( p != NULL )
+    {
+        /* We have a login */
+        url->psz_username = psz_parse;
+        *p++ = '\0';
 
-            psz_parse = p;
+        psz_parse = strchr( psz_parse, ':' );
+        if( psz_parse != NULL )
+        {
+            /* We have a password */
+            *psz_parse++ = '\0';
+            url->psz_password = psz_parse;
         }
+
+        psz_parse = p;
     }
 
     p = strchr( psz_parse, '/' );