From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-26 7a8f22b: * test/lisp/url/url-file-tests.el (url-file): Use file:///, not file://. Date: Fri, 28 Jun 2019 00:30:43 +0200 Message-ID: References: <20190615033014.12012.75126@vcs0.savannah.gnu.org> <20190615033015.46910210EC@vcs0.savannah.gnu.org> <9c367baa-841d-24e0-1436-1a8f3a3ed081@cornell.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000096cc18058c55b833" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="121921"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "emacs-devel@gnu.org" To: Ken Brown Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 28 00:32:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgcwJ-000VXJ-Vd for ged-emacs-devel@m.gmane.org; Fri, 28 Jun 2019 00:32:24 +0200 Original-Received: from localhost ([::1]:55038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcwI-0007q7-Tx for ged-emacs-devel@m.gmane.org; Thu, 27 Jun 2019 18:32:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43307) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgcvT-0007pl-Un for emacs-devel@gnu.org; Thu, 27 Jun 2019 18:31:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgcvS-00022p-Dx for emacs-devel@gnu.org; Thu, 27 Jun 2019 18:31:31 -0400 Original-Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]:45457) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgcvR-0001u0-AV for emacs-devel@gnu.org; Thu, 27 Jun 2019 18:31:29 -0400 Original-Received: by mail-qt1-x82f.google.com with SMTP id j19so4238615qtr.12 for ; Thu, 27 Jun 2019 15:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KG336YYFZcC7gQPeejJE9VnXzMm7E2FmwauISBplbHE=; b=A7xuNoaqc/binHmauOD+lyz7AMTwHbxW+sVFg9RP71mVsGPsVjsE8gR6lV0FEh3UY3 eV89034GzEhlEoBct5z4qy8J8hchByDi/TCCPGrm82jKMhjd9H7DfH/8rPh02oWFd33H KbdLdP+ZtR9csV6mgazzlgmltrlKEWeh2ER1FzSAoOo4TquM8BEDqwYgA8fIvOFEneFH rS/1iLfl+92SPfX9M+ZkHcr4C6MmePpA3VTXTKEvv2ZXxbay/LeZs1edFt/QM0/V0jUS ZpEDt3/Ths9QibeMLKjrLG1/Rds2JIFLO3I1FnTJxBGaU41WWVCUNXEWgIRAJBlL3FZC K3Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KG336YYFZcC7gQPeejJE9VnXzMm7E2FmwauISBplbHE=; b=iSlKvop4AHExYrLr2v4/QE2xXHlXMNrah3L6rMofhXYvBuyuy2KADUjDTkRilAzgF/ onaQJSl77JdiXj67z2qYLrHsSTL7KunacnDSLtwgs5YcUYpIIdnUAscEhCyUkBh+K9N6 uq0PdRymMtC4xBNgwLD7RU0vIT/3yIU+2yp4wK7KHKNZNrLC65gACZ6/bIxieT65a0hI AQie18Gjcxp+k1MT0st4F31Tv1Rm8RFeF7G/HCESeY3hVgt4dmxKBZ6JQdTUrayiDNnt gXUMhBKGPXNVkAHVgjuJeHgpFAkPHENMVMrrhWyoMqXwsisHijph4d2SIoxtBGmJ4LsH 6MvA== X-Gm-Message-State: APjAAAWPC83XF9/demI0yZ/yvn5WRz/Jun/GEJvuHtxME5y3cJOHh/qf HVEVe34+/aZRqizT6Ut3SENvxxg8jttm99Ywwps= X-Google-Smtp-Source: APXvYqwTT8z5lm0e5TzElcwJT9NvjnKFGEaAy9zEHhkoUM41xpryZDhp7EVD4iS12PyMlH7yjlCPkRhBgl7SGCJPVgY= X-Received: by 2002:a0c:b5c5:: with SMTP id o5mr5614281qvf.6.1561674680549; Thu, 27 Jun 2019 15:31:20 -0700 (PDT) In-Reply-To: <9c367baa-841d-24e0-1436-1a8f3a3ed081@cornell.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::82f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238205 Archived-At: --00000000000096cc18058c55b833 Content-Type: text/plain; charset="UTF-8" On Thu, Jun 27, 2019 at 11:57 PM Ken Brown wrote: > This change causes the test to fail on Cygwin. I think the original "file://" > is the correct prefix. If concatenated with "/some/file", it yields the URL > "file:///some/file". Your version with "file:///" as the prefix yields > "file:////some/file", which would refer to a local file "//some/file". It's a long-standing issue. The standard says that two slashes are to be followed by a hostname, Three slashes, if there's no hostname. So, in fact, Posix apps should strip the initial slash of an absolute pathname before concatenating it to file:/// https://tools.ietf.org/html/rfc8089 Appendix B. Example URIs > The syntax in Section 2 is intended to support file URIs that take > the following forms: > Local files: > o A traditional file URI for a local file with an empty authority. > This is the most common format in use today. For example: > * "file:///path/to/file" https://en.wikipedia.org/wiki/File_URI_scheme#How_many_slashes? * A valid file URI must therefore begin with either file:/path, > file:///path or file://hostname/path. > * file://path (i.e. two slashes, without a hostname) is never correct, but > is often used. The test, as it is now, works for the native Windows port and fails for the Cygwin port. So to work on both, some special-casing will have to be done. Note that file:/// is already used in several places in the sources. > Posix says that the meaning of a path name starting with exactly two slashes is > implementation-defined. On Cygwin, it's interpreted as a UNC path name, > referring to a file on a network. This is not about Posix pathnames, but RFC8089 URI schemes. --00000000000096cc18058c55b833 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Thu, Jun 27, 2019 at 11:57 PM Ken Brown <kbrown@cornell.edu> wrote:

>= ; This change causes the test to fail on Cygwin.=C2=A0 I think the original= "file://"
> is the correct prefix.=C2=A0 If concatenated w= ith "/some/file", it yields the URL
> "file:///some/fi= le".=C2=A0 Your version with "file:///" as the prefix yields=
> "file:////some/file", which would refer to a local file = "//some/file".

It's a long-standing issue. The standar= d says that two slashes are to be followed by a hostname, Three slashes, if= there's no hostname.

So, in fact, Posix apps should= strip the initial slash of an absolute pathname before concatenating it to= file:///

https= ://tools.ietf.org/html/rfc8089

Appendix B.=C2=A0 Example URIs
=C2=A0 =C2=A0The syntax = in Section 2 is intended to support file URIs that take
=C2=A0 =C2=A0the= following forms:
=C2=A0 =C2=A0Local files:
=C2=A0 =C2=A0o =C2=A0A tr= aditional file URI for a local file with an empty authority.
=C2=A0 =C2= =A0 =C2=A0 This is the most common format in use today.=C2=A0 For example:<= br>=C2=A0 =C2=A0 =C2=A0 * =C2=A0"file:///path/to/file"

https://en.wikipedia.org/wiki/File_URI_sche= me#How_many_slashes?

* A valid file URI must therefore begin with either file:/pa= th, file:///path or file://hostname/path.
* file://path (i.e. two slashe= s, without a hostname) is never correct, but is often used.

The test, as it is now, works for the native Windows= port and fails for the Cygwin port. So to work on both, some special-casin= g will have to be done.=C2=A0

Note that file:/// i= s already used in several places in the sources.

&= gt; Posix says that the meaning of a path name starting with exactly two sl= ashes is
> implementation-defined.=C2=A0 On Cygwin, it's interpre= ted as a UNC path name,
> referring to a file on a network.

This is not about Posix pathnames, but RFC8089 URI schemes.
<= div>

--00000000000096cc18058c55b833--