changeset 2868:22467d1cf49c libavformat

Try to fix url_split() so that the ?foobar part is in the path and only the path.
author michael
date Sat, 29 Dec 2007 16:13:03 +0000
parents 57818580a457
children 02e909632f18
files utils.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Fri Dec 28 13:07:43 2007 +0000
+++ b/utils.c	Sat Dec 29 16:13:03 2007 +0000
@@ -2941,7 +2941,7 @@
                char *path, int path_size,
                const char *url)
 {
-    const char *p, *ls, *at, *col, *brk, *q;
+    const char *p, *ls, *at, *col, *brk;
 
     if (port_ptr)               *port_ptr = -1;
     if (proto_size > 0)         proto[0] = 0;
@@ -2962,12 +2962,12 @@
     }
 
     /* separate path from hostname */
-    if ((ls = strchr(p, '/'))) {
-        if ((q = strchr(ls, '?')))
-            av_strlcpy(path, ls, FFMIN(path_size, q - ls + 1));
-        else
+    ls = strchr(p, '/');
+    if(!ls)
+        ls = strchr(p, '?');
+    if(ls)
             av_strlcpy(path, ls, path_size);
-    } else if (!(ls = strchr(p, '?')))
+    else
         ls = &p[strlen(p)]; // XXX
 
     /* the rest is hostname, use that to parse auth/port */