]> git.sesse.net Git - vlc/commitdiff
Sort of handle ;type= in FTP URLs
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 20 Jul 2009 15:58:56 +0000 (18:58 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 20 Jul 2009 15:59:51 +0000 (18:59 +0300)
modules/access/ftp.c

index 78330f887106950208820ab19eaac3bdd6c34963..7a463e93090c9f4b5982dd379fa128674472b516 100644 (file)
@@ -302,11 +302,19 @@ static int parseURL( vlc_url_t *url, const char *path )
     if( url->i_port <= 0 )
         url->i_port = IPPORT_FTP; /* default port */
 
-    /* FTP URLs are relative to user's default directory (RFC1738)
+    /* FTP URLs are relative to user's default directory (RFC1738 §3.2)
     For absolute path use ftp://foo.bar//usr/local/etc/filename */
-
+    /* FIXME: we should issue a series of CWD, one per slash */
     if( url->psz_path && *url->psz_path == '/' )
         url->psz_path++;
+
+    char *type = strstr( url->psz_path, ";type=" );
+    if( type )
+    {
+        *type = '\0';
+        if( strchr( "iI", type[6] ) == NULL )
+            return VLC_EGENERIC; /* ASCII and directory not supported */
+    }
     decode_URI( url->psz_path );
     return VLC_SUCCESS;
 }