[vlc-devel] commit: Sort of handle ;type= in FTP URLs ( Rémi Denis-Courmont )

git version control git at videolan.org
Mon Jul 20 18:00:54 CEST 2009


vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 20 18:58:56 2009 +0300| [96cfd5c63ee840ae42d88b0eb36d9b167f74bdf7] | committer: Rémi Denis-Courmont 

Sort of handle ;type= in FTP URLs
(cherry picked from commit 0772c250d4e35ac3655b8c0bb1d6ec33d0f6bdf6)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=96cfd5c63ee840ae42d88b0eb36d9b167f74bdf7
---

 modules/access/ftp.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 390dec6..dffea0d 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -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;
 }




More information about the vlc-devel mailing list