[FFmpeg-cvslog] r25319 - trunk/libavformat/applehttp.c
mstorsjo
subversion
Sat Oct 2 23:59:16 CEST 2010
Author: mstorsjo
Date: Sat Oct 2 23:59:16 2010
New Revision: 25319
Log:
applehttp: Add comments to make_absolute_url
Modified:
trunk/libavformat/applehttp.c
Modified: trunk/libavformat/applehttp.c
==============================================================================
--- trunk/libavformat/applehttp.c Sat Oct 2 23:58:36 2010 (r25318)
+++ trunk/libavformat/applehttp.c Sat Oct 2 23:59:16 2010 (r25319)
@@ -90,18 +90,21 @@ static void make_absolute_url(char *buf,
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,
av_strlcat(buf, "/", size);
break;
}
+ /* Cut off the directory name */
if (sep)
sep[1] = '\0';
else
More information about the ffmpeg-cvslog
mailing list