cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: patch to make drive letters work in file:// urls under Window s

From: David Byron <DByron_at_everdreamcorp.com>
Date: Thu, 7 Aug 2003 09:30:09 -0700

On Wed Aug 06 2003, Dan Fandrich wrote:

> > However, before this patch,
> >
> > $ ./curl -v file://localhost/c:/src/cobra/curl/tests/log/test200.txt
> >
> > curl would look for /c:/src/cobra/curl/tests/log/test200.txt and not
> > find anything. After this patch, curl looks in
> > c:/src/cobra/curl/tests/log/test200.txt and happily finds what it's
> > looking for.
>
> This part is good. Perhaps change the patch to do something like:
>
> if (*actual_path == '/' &&
> (actual_path[2] == ':' || actual_path[2] == '|'))
> { actual_path[2] = ':'; actual_path++; }
>
> but better, with an end-of-buffer check and make sure you're
> allowed to change the | to : there in that buffer like that.

Was sort of waiting for a comment from Daniel about this. Is the test for a
colon really necessary?

What I don't like about the situation with the patch is that I can't figure
out how to specify paths from the root of the current drive. Not sure this
is supposed to be supported, or supported by browsers or what.

For example,

file://localhost/src/blah

is a relative path -- src/blah from the current directory

What I think I want is for

file://localhost//src/blah

to be /src/blah from the root of the current drive.

Because of the parsing in url.c (I think), the extra slash gets blown away.

I don't think the test for a colon improves this though. It would make both
of these URLs get interpreted from the root of the current drive.

-DB

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-07