summaryrefslogtreecommitdiff
path: root/content/fetchers/fetch_curl.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2010-03-31 13:59:57 +0000
committerVincent Sanders <vince@netsurf-browser.org>2010-03-31 13:59:57 +0000
commit95e4a737de53dc2f02a2db95b26151d9d494bc0c (patch)
treea9dcb06c696a463f824d61865fb46d6a7bfa755b /content/fetchers/fetch_curl.c
parent9f575c590b3c304ab02707ee3378bd2e4f4c9094 (diff)
downloadnetsurf-95e4a737de53dc2f02a2db95b26151d9d494bc0c.tar.gz
netsurf-95e4a737de53dc2f02a2db95b26151d9d494bc0c.tar.bz2
rationalise the usage of the file scheme
svn path=/trunk/netsurf/; revision=10221
Diffstat (limited to 'content/fetchers/fetch_curl.c')
-rw-r--r--content/fetchers/fetch_curl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/content/fetchers/fetch_curl.c b/content/fetchers/fetch_curl.c
index 9ac3ad7b3..e5ff6bf71 100644
--- a/content/fetchers/fetch_curl.c
+++ b/content/fetchers/fetch_curl.c
@@ -1098,7 +1098,6 @@ size_t fetch_curl_header(char *data, size_t size, size_t nmemb,
#undef SKIP_ST
}
-
/**
* Find the status code and content type and inform the caller.
*
@@ -1154,10 +1153,12 @@ bool fetch_curl_process_headers(struct curl_fetch_info *f)
}
/* find MIME type from filetype for local files */
- if (strncmp(f->url, "file:///", 8) == 0) {
+ if (strncmp(f->url, FILE_SCHEME_PREFIX, FILE_SCHEME_PREFIX_LEN) == 0) {
struct stat s;
- char *url_path = curl_unescape(f->url + 7,
- (int) strlen(f->url + 7));
+ char *url_path = curl_unescape(f->url + FILE_SCHEME_PREFIX_LEN,
+ (int) strlen(f->url + FILE_SCHEME_PREFIX_LEN));
+
+ LOG(("Obtaining mime type for file %s", url_path));
if (url_path != NULL && stat(url_path, &s) == 0) {
/* file: URL and file exists */