aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/applehttp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-10-02 21:59:16 +0000
committerMartin Storsjö <martin@martin.st>2010-10-02 21:59:16 +0000
commitae8c28db87c5bfb5721a91014a657e56983c6c57 (patch)
tree6c4ab7146d1443743aa8f87f8d602e8b9e7d2b08 /libavformat/applehttp.c
parent9d229ef9e6505f3780df9f7e6b362612b2d53875 (diff)
downloadffmpeg-ae8c28db87c5bfb5721a91014a657e56983c6c57.tar.gz
applehttp: Add comments to make_absolute_url
Originally committed as revision 25319 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/applehttp.c')
-rw-r--r--libavformat/applehttp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index f2f583892d..4a4611c9bb 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -90,18 +90,21 @@ static void make_absolute_url(char *buf, int size, const char *base,
const char *rel)
{
char *sep;
+ /* If rel actually is an absolute url, just copy it */
if (!base || strstr(rel, "://") || rel[0] == '/') {
av_strlcpy(buf, rel, size);
return;
}
if (base != buf)
av_strlcpy(buf, base, size);
+ /* Remove the file name from the base url */
sep = strrchr(buf, '/');
if (sep)
sep[1] = '\0';
else
buf[0] = '\0';
while (av_strstart(rel, "../", NULL) && sep) {
+ /* Remove the path delimiter at the end */
sep[0] = '\0';
sep = strrchr(buf, '/');
/* If the next directory name to pop off is "..", break here */
@@ -110,6 +113,7 @@ static void make_absolute_url(char *buf, int size, const char *base,
av_strlcat(buf, "/", size);
break;
}
+ /* Cut off the directory name */
if (sep)
sep[1] = '\0';
else