[vlc-commits] var_LocationParse(): accept semicolon as separator

Rémi Denis-Courmont git at videolan.org
Tue Aug 21 16:01:36 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Aug 21 16:59:42 2012 +0300| [246951ccba84c9154349c50c01c9f6c8ff2d7a9d] | committer: Rémi Denis-Courmont

var_LocationParse(): accept semicolon as separator

This is for backward compatibility with existing VLC playlists and
VLC playlist generators.
(cherry picked from commit cb9a583ca2434457162da922548371cd30be7675)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=246951ccba84c9154349c50c01c9f6c8ff2d7a9d
---

 src/misc/variables.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/misc/variables.c b/src/misc/variables.c
index 5e32323..bcbce8d 100644
--- a/src/misc/variables.c
+++ b/src/misc/variables.c
@@ -1091,8 +1091,10 @@ cleanup:
 
 #undef var_LocationParse
 /**
- * Parses a set of colon-separated <variable name>=<value> pairs. Some access
- * (or access_demux) plugins uses this scheme in media resource location.
+ * Parses a set of colon-separated or semicolon-separated
+ * <variable name>=<value> pairs.
+ * Some access (or access_demux) plugins uses this scheme
+ * in media resource location.
  * @note Only trusted/safe variables are allowed. This is intended.
  *
  * @warning Only use this for plugins implementing VLC-specific resource
@@ -1112,9 +1114,9 @@ int var_LocationParse (vlc_object_t *obj, const char *mrl, const char *pref)
     assert(mrl != NULL);
     while (*mrl != '\0')
     {
-        mrl += strspn (mrl, ":"); /* skip leading colon(s) */
+        mrl += strspn (mrl, ":;"); /* skip leading colon(s) */
 
-        size_t len = strcspn (mrl, ":");
+        size_t len = strcspn (mrl, ":;");
         char *buf = malloc (preflen + len);
 
         if (likely(buf != NULL))



More information about the vlc-commits mailing list