This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Problematic interpretion of paths starting with double slashes
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: "Sven Eden" <sven dot eden at gmx dot de>, cygwin at cygwin dot com
- Date: Wed, 13 Jun 2018 15:50:36 +0300
- Subject: Re: Problematic interpretion of paths starting with double slashes
- References: <trinity-82173dac-d842-4a87-8d1f-bed9a958d178-1528793630066@3c-app-gmx-bs08> <dc8418d2-2004-97f0-2d8c-ab438f007eba@redhat.com> <trinity-2aa37c55-032a-4631-9d8f-657ecd85e170-1528809265158@3c-app-gmx-bs08> <00de90b8-a2b4-f751-1ef2-05645a3f1119@SystematicSw.ab.ca> <trinity-709441a4-b53d-4bbd-96fb-91ad85816938-1528878894364@3c-app-gmx-bs06>
- Reply-to: cygwin at cygwin dot com
Greetings, Sven Eden!
>> Gesendet: Dienstag, 12. Juni 2018 um 18:28 Uhr
>> Von: "Brian Inglis" <Brian.Inglis@SystematicSw.ab.ca>
>> On 2018-06-12 07:14, Sven Eden wrote:
>> >> Gesendet: Dienstag, 12. Juni 2018 um 13:52 Uhr
>> >> Von: "Eric Blake" <eblake@redhat.com>
>> >> Then fix your script to provide 3 slashes instead of 2. Only 2 slashes
>> >> has the magic UNC behavior.
>> > It is not my script. *my* scripts are portable by all means.
>> >> That is, if you have a script that is concatenating:
>> >> ${prefix}/${dir}
>> >> where ${prefix} might be empty, you can always rewrite it to be:
>> >> ${prefix}///${dir}
>> > The script was "fixed" from ${prefix}/${dir} a while ago. Before that the
>> > outcome was "///". Which is very bad style. Good style is to guarantee, that
>> > not more than one slash is issued.
>>
>> Which is equivalent to //localhost/ on Cygwin and elsewhere - / on Linux - this
>> is semantics not "style".
> I talked about replacing something wrong with something
> worse. That's style, not semantics. But I get what you are
> meaning. ;-)
If it is documented, it is not wrong.
> However, from my two questions, one was answered, and I can
> figure out the other just fine by myself.
> Q: Can the handling of // be extended to check for / if the
> first fails?
> A: Yes
Can? Yes. Purely technically. But for consistency it will not be.
Ambiguous paths are a big no-no.
--
With best regards,
Andrey Repin
Wednesday, June 13, 2018 15:48:59
Sorry for my terrible english...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple