|
|
@ -90,7 +90,7 @@ static void make_absolute_url(char *buf, int size, const char *base, |
|
|
|
const char *rel) |
|
|
|
const char *rel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
char *sep; |
|
|
|
char *sep; |
|
|
|
if (!base || strstr(rel, "://")) { |
|
|
|
if (!base || strstr(rel, "://") || rel[0] == '/') { |
|
|
|
av_strlcpy(buf, rel, size); |
|
|
|
av_strlcpy(buf, rel, size); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -99,13 +99,15 @@ static void make_absolute_url(char *buf, int size, const char *base, |
|
|
|
sep = strrchr(buf, '/'); |
|
|
|
sep = strrchr(buf, '/'); |
|
|
|
if (sep) |
|
|
|
if (sep) |
|
|
|
sep[1] = '\0'; |
|
|
|
sep[1] = '\0'; |
|
|
|
while (av_strstart(rel, "../", NULL)) { |
|
|
|
else |
|
|
|
if (sep) { |
|
|
|
buf[0] = '\0'; |
|
|
|
|
|
|
|
while (av_strstart(rel, "../", NULL) && sep) { |
|
|
|
sep[0] = '\0'; |
|
|
|
sep[0] = '\0'; |
|
|
|
sep = strrchr(buf, '/'); |
|
|
|
sep = strrchr(buf, '/'); |
|
|
|
if (sep) |
|
|
|
if (sep) |
|
|
|
sep[1] = '\0'; |
|
|
|
sep[1] = '\0'; |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
buf[0] = '\0'; |
|
|
|
rel += 3; |
|
|
|
rel += 3; |
|
|
|
} |
|
|
|
} |
|
|
|
av_strlcat(buf, rel, size); |
|
|
|
av_strlcat(buf, rel, size); |
|
|
|