curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: file:// test URLs

From: Marcel Raad via curl-library <curl-library_at_cool.haxx.se>
Date: Sat, 19 Oct 2019 08:05:13 +0000

> -----Original Message-----
> From: curl-library <curl-library-bounces_at_cool.haxx.se> On Behalf Of Ray
> Satiro via curl-library
> Sent: Samstag, 19. Oktober 2019 07:24
> To: curl-library_at_cool.haxx.se
> Cc: Ray Satiro <raysatiro_at_yahoo.com>
> Subject: Re: file:// test URLs
>
> Older versions allowed
> something like file://localhost/foo to read from the root of the current
> drive but that wouldn't work the way you expect. Like if the current
> drive was c it would have attempted c:/home/marcel/curl/..... Recent
> versions are stricter. I don't think it's an MSYS bug. curl for windows
> ( I assume WIN32 is defined here?) is going to attempt to write to
> windows paths, does msys filter that? I know it does with command line
> arguments so if you write -o /home/marcel/curl/out it actually changes
> the argument to something like -o
> C:/MinGW/msys/1.0/home/marcel/curl/out. I have an argumentparser [1]
> that can show you what happens.

Thanks, that tool is very useful!

So what happens with file://localhost/home/marcel/curl/tests/log/test200.txt
is that curl receives that argument as is, it successfully writes to /home/marcel/curl/tests/log/test200.txt,
which translates to the Windows path C:\msys64\home\marcel\curl\tests\log\test200.txt,
and the test passes.

What happens with file://localhost//home/marcel/curl/tests/log/test200.txt
is that it receives the argument as is, tries to write to //home/marcel/curl/tests/log/test200.txt, and fails.

WIN32 is not defined when building with the MSYS GCC.

Marcel

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-10-19