From bc2d96368ffb1062aee03100f25b326519d2a1f3 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 1 Jul 2006 22:27:10 +0000 Subject: Fix conversion of URLs beginning "file://". Additionally, file://host/... isn't likely, so assume file://path & convert to file:///path svn path=/trunk/netsurf/; revision=2685 --- content/fetchcache.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'content/fetchcache.c') diff --git a/content/fetchcache.c b/content/fetchcache.c index eb47f332a..7153c629b 100644 --- a/content/fetchcache.c +++ b/content/fetchcache.c @@ -86,17 +86,13 @@ struct content * fetchcache(const char *url, strncasecmp(url, "file:/", 6) == 0) { /* Manipulate file URLs into correct format */ if (strncasecmp(url, "file://", 7) == 0) { - /* file://host/... */ - char *slash = 0; - + /* file://path */ url1 = malloc(7 + strlen(url)); if (!url1) return NULL; strcpy(url1, "file://"); - slash = strchr(url + 7, '/'); - if (slash) - strcat(url1 + 7, slash); + strcat(url1 + 7, url + 6); } else { /* file:/... */ url1 = malloc(7 + strlen(url)); -- cgit v1.2.3