[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 95b1eacd47: Fix handling of UNCs in 'parse-colon-path

From: Ken Brown
Subject: Re: master 95b1eacd47: Fix handling of UNCs in 'parse-colon-path
Date: Thu, 25 Aug 2022 08:56:25 -0400
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2

On 8/25/2022 1:18 AM, Eli Zaretskii wrote:
Date: Wed, 24 Aug 2022 18:03:35 -0400
Cc: emacs-devel@gnu.org
From: Ken Brown <kbrown@cornell.edu>

Ugh, it means the test data needs to be split three-way: one for
MS-Windows/MS-DOS, another for Cygwin, and one more for the rest.
Because Cygwin is like Posix systems, but it does want to support

It's not just the test data that's wrong on Cygwin, but parse-colon-path is
wrong: It always collapses multiple leading slashes to two.

That's what substitute-in-file-name does as well (in the Cygwin and
MS-Windows/MS-DOS builds), and the change I made was meant to restore
backward compatibility with what parse-colon-path did as result of
using substitute-in-file-name.

Posix says that multiple leading slashes are equivalent to one slash *except* in
the case of exactly two leading slashes.  In that case, the interpretation is

This is not about Posix, this is about the Emacs-specific feature of
handling multiple consecutive slashes.  In particular, in Emacs,
"/foo//bar" yields "/bar", not "/foo/bar" per Posix.

OK, I completely missed the point.

Cygwin follows Posix and chooses to interpret precisely two leading slashes as
referring to a UNC path.  In particular, 3 or more slashes should be collapsed
to 1 slash, as on other Posix systems, while exactly 2 leading slashes should be
left alone.

I'm not against changing the behavior of substitute-in-file-name and
parse-colon-path in this regard, but it would be a separate change,
and of a long-standing behavior.  This particular change just restored
what parse-colon-path did back when it used substitute-in-file-name.

I think you're right, and it's just a matter of fixing the test. Thanks for the explanation.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]