unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ken Brown <kbrown@cornell.edu>
Cc: emacs-devel@gnu.org
Subject: Re: master 95b1eacd47: Fix handling of UNCs in 'parse-colon-path
Date: Thu, 25 Aug 2022 08:18:09 +0300	[thread overview]
Message-ID: <83mtbs52b2.fsf@gnu.org> (raw)
In-Reply-To: <72e69a8e-13ba-f36f-d6bd-c4ed4bb0e53e@cornell.edu> (message from Ken Brown on Wed, 24 Aug 2022 18:03:35 -0400)

> 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
> > UNCs.
> 
> 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 
> implementation-dependent.

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.

> 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.



  reply	other threads:[~2022-08-25  5:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <166135805961.19216.9573795919733967151@vcs2.savannah.gnu.org>
     [not found] ` <20220824162100.7A8DFC0088A@vcs2.savannah.gnu.org>
2022-08-24 18:34   ` master 95b1eacd47: Fix handling of UNCs in 'parse-colon-path Ken Brown
2022-08-24 18:48     ` Eli Zaretskii
2022-08-24 22:03       ` Ken Brown
2022-08-25  5:18         ` Eli Zaretskii [this message]
2022-08-25 12:56           ` Ken Brown
2022-08-27 23:04             ` Ken Brown
2022-08-28  5:16               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtbs52b2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=kbrown@cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).