|
|
@@ -4786,7 +4786,7 @@ void av_url_split(char *proto, int proto_size, |
|
|
|
char *hostname, int hostname_size, |
|
|
|
int *port_ptr, char *path, int path_size, const char *url) |
|
|
|
{ |
|
|
|
const char *p, *ls, *ls2, *at, *at2, *col, *brk; |
|
|
|
const char *p, *ls, *at, *at2, *col, *brk; |
|
|
|
|
|
|
|
if (port_ptr) |
|
|
|
*port_ptr = -1; |
|
|
@@ -4814,16 +4814,8 @@ void av_url_split(char *proto, int proto_size, |
|
|
|
} |
|
|
|
|
|
|
|
/* separate path from hostname */ |
|
|
|
ls = strchr(p, '/'); |
|
|
|
ls2 = strchr(p, '?'); |
|
|
|
if (!ls) |
|
|
|
ls = ls2; |
|
|
|
else if (ls && ls2) |
|
|
|
ls = FFMIN(ls, ls2); |
|
|
|
if (ls) |
|
|
|
av_strlcpy(path, ls, path_size); |
|
|
|
else |
|
|
|
ls = &p[strlen(p)]; // XXX |
|
|
|
ls = p + strcspn(p, "/?#"); |
|
|
|
av_strlcpy(path, ls, path_size); |
|
|
|
|
|
|
|
/* the rest is hostname, use that to parse auth/port */ |
|
|
|
if (ls != p) { |
|
|
|