[Top][All Lists]

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

Re: [Emacs-diffs] emacs-26 7a8f22b: * test/lisp/url/url-file-tests.el (u

From: Juanma Barranquero
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

On Thu, Jun 27, 2019 at 11:57 PM Ken Brown <address@hidden> 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:///


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"


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

reply via email to

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