From 95e4a737de53dc2f02a2db95b26151d9d494bc0c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 31 Mar 2010 13:59:57 +0000 Subject: rationalise the usage of the file scheme svn path=/trunk/netsurf/; revision=10221 --- content/fetchers/fetch_curl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'content/fetchers') 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 */ -- cgit v1.2.3