aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-12-29 16:13:03 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-12-29 16:13:03 +0000
commit7ef55085f0c5333d7fc7bfa1e87015c5a71e0ad9 (patch)
treefbc20d38bb39f4332fc75a7fc9593bd32677cddc
parent18be65dd796c051e916f0533ab9804783ddb948e (diff)
downloadffmpeg-7ef55085f0c5333d7fc7bfa1e87015c5a71e0ad9.tar.gz
Try to fix url_split() so that the ?foobar part is in the path and only the path.
Originally committed as revision 11347 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/utils.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1e0edac3df..9e6b12f9af 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2941,7 +2941,7 @@ void url_split(char *proto, int proto_size,
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 @@ void url_split(char *proto, int proto_size,
}
/* 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 */