cURL / Mailing Lists / curl-users / Single Mail

curl-users

libcurl's treatment of `file:' and absolute paths

From: Stefan Ulrich <stefan.ulrich_at_elexir.de>
Date: Sat, 14 Jul 2001 16:34:50 +0200

Hi,

A question on the `file:' access scheme: Currently libcurl
extracts from a URL like
   file://localhost/path/to/file
the following path component:
   path/to/file
Since the leading '/' is removed from the path, fetching this
file fails on my Linux system.

I must admit that from reading RFCs 1738 and 2396, I couldn't tell
for sure whether the above URL is correct or whether it should be
   file://localhost//path/to/file
instead. OTOH, the form with one `/' following the `localhost' is
rather common (as a quick search on Google for `file://localhost/'
shows), and it is supported by most browsers and also by W3C's
libwww. So maybe libcurl should support it as well?

(Even though I'm not sure how this should be implemented - I guess
just replacing the
      strcpy(conn->path, &conn->path[10]);
by
      strcpy(conn->path, &conn->path[9]);
in line 1430 of url.c would break the path for non-Unix systems?)

Cheers,

-- 
Stefan Ulrich
Received on 2001-07-14