summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-07-01 22:27:10 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-07-01 22:27:10 +0000
commitbc2d96368ffb1062aee03100f25b326519d2a1f3 (patch)
treed0feea0ca01b3e1ecbf27611bb81a3fd34291d4b /content
parent28a7ed4989b3798087258dbc7ac7109298316ef3 (diff)
downloadnetsurf-bc2d96368ffb1062aee03100f25b326519d2a1f3.tar.gz
netsurf-bc2d96368ffb1062aee03100f25b326519d2a1f3.tar.bz2
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
Diffstat (limited to 'content')
-rw-r--r--content/fetchcache.c8
1 files changed, 2 insertions, 6 deletions
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));