char *path, int path_size,
const char *url)
{
- const char *p, *ls, *at, *col, *brk;
+ const char *p, *ls, *at, *col, *brk, *q;
if (port_ptr) *port_ptr = -1;
if (proto_size > 0) proto[0] = 0;
}
/* separate path from hostname */
- if ((ls = strchr(p, '/')))
- av_strlcpy(path, ls, path_size);
- else
+ if ((ls = strchr(p, '/'))) {
+ if ((q = strchr(ls, '?')))
+ av_strlcpy(path, ls, FFMIN(path_size, q - ls + 1));
+ else
+ av_strlcpy(path, ls, path_size);
+ } else if (!(ls = strchr(p, '?')))
ls = &p[strlen(p)]; // XXX
/* the rest is hostname, use that to parse auth/port */