]> git.sesse.net Git - vlc/commitdiff
vlc_UrlParse: end username at the last @ rather than the first
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 16 Jun 2013 12:11:03 +0000 (15:11 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 16 Jun 2013 12:12:20 +0000 (15:12 +0300)
This fixes the corner where the username or the password contains @
(although encoding would probably be a better idea).

src/text/url.c

index 06fb8177577dfe74b8b61bb523a64585da11384e..40043baae3cb18109c83814e61b3aa5a755e52b4 100644 (file)
@@ -433,7 +433,7 @@ void vlc_UrlParse (vlc_url_t *restrict url, const char *str, unsigned char opt)
         url->psz_path = "/";*/
 
     /* User name */
-    next = strchr (cur, '@');
+    next = strrchr (cur, '@');
     if (next != NULL)
     {
         *(next++) = '\0';