[vlc-devel] commit: Zip: use !/ as separator instead of | (Jean-Philippe Andre )

git version control git at videolan.org
Tue May 19 18:16:53 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Philippe Andre <jpeg at via.ecp.fr> | Tue May 19 23:45:09 2009 +0800| [6d9b338311d6d0664926425cd44a27b8759a9a65] | committer: Jean-Philippe Andre 

Zip: use !/ as separator instead of |

As advised on the forum, !/ is the standard separator for JAR protocol.

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

 modules/access/zip/zip.h       |    4 ++--
 modules/access/zip/zipaccess.c |   11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/modules/access/zip/zip.h b/modules/access/zip/zip.h
index d52f8d5..a6d7b62 100644
--- a/modules/access/zip/zip.h
+++ b/modules/access/zip/zip.h
@@ -42,8 +42,8 @@
 
 #define ZIP_FILENAME_LEN 512
 #define ZIP_BUFFER_LEN 32768
-#define ZIP_SEP      "|"
-#define ZIP_SEP_CHAR '|'
+#define ZIP_SEP      "!/"
+#define ZIP_SEP_LEN  2
 
 
 /** **************************************************************************
diff --git a/modules/access/zip/zipaccess.c b/modules/access/zip/zipaccess.c
index 1c5d678..6f04d91 100644
--- a/modules/access/zip/zipaccess.c
+++ b/modules/access/zip/zipaccess.c
@@ -22,7 +22,7 @@
  *****************************************************************************/
 
 /** @todo:
- * - implement crypto (using url zip://user:password@path-to-archive|file
+ * - implement crypto (using url zip://user:password@path-to-archive!/file)
  * - read files in zip with long name (use unz_file_info.size_filename)
  * - multi-volume archive support ?
  */
@@ -112,9 +112,12 @@ int AccessOpen( vlc_object_t *p_this )
 
     /* Split the MRL */
     psz_path = strdup( p_access->psz_path );
-    psz_sep = strchr( psz_path, ZIP_SEP_CHAR );
+    psz_sep = strstr( psz_path, ZIP_SEP );
     if( !psz_sep )
+    {
+        msg_Dbg( p_access, "path does not contain separator " ZIP_SEP );
         return VLC_EGENERIC;
+    }
 
     *psz_sep = '\0';
     psz_pathToZip = unescapeXml( psz_path );
@@ -125,10 +128,10 @@ int AccessOpen( vlc_object_t *p_this )
                  psz_path );
         psz_pathToZip = strdup( psz_path );
     }
-    p_sys->psz_fileInzip = unescapeXml( psz_sep + 1 );
+    p_sys->psz_fileInzip = unescapeXml( psz_sep + ZIP_SEP_LEN );
     if( !p_sys->psz_fileInzip )
     {
-        p_sys->psz_fileInzip = strdup( psz_sep + 1 );
+        p_sys->psz_fileInzip = strdup( psz_sep + ZIP_SEP_LEN );
     }
 
     /* Define IO functions */




More information about the vlc-devel mailing list