unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Ken Brown <kbrown@cornell.edu>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
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	[thread overview]
Message-ID: <CAAeL0SQyUc-M4favEpCprmHjp6rw6dqgdBu6JpXOp03TjJRhuw@mail.gmail.com> (raw)
In-Reply-To: <9c367baa-841d-24e0-1436-1a8f3a3ed081@cornell.edu>

[-- Attachment #1: Type: text/plain, Size: 1731 bytes --]

On Thu, Jun 27, 2019 at 11:57 PM Ken Brown <kbrown@cornell.edu> 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.

[-- Attachment #2: Type: text/html, Size: 2632 bytes --]

  reply	other threads:[~2019-06-27 22:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190615033014.12012.75126@vcs0.savannah.gnu.org>
     [not found] ` <20190615033015.46910210EC@vcs0.savannah.gnu.org>
2019-06-27 21:57   ` [Emacs-diffs] emacs-26 7a8f22b: * test/lisp/url/url-file-tests.el (url-file): Use file:///, not file:// Ken Brown
2019-06-27 22:30     ` Juanma Barranquero [this message]
2019-06-27 23:37       ` Ken Brown
2019-06-28  1:22         ` Juanma Barranquero
2019-06-28  3:13           ` Ken Brown
2019-06-28  4:08             ` Juanma Barranquero
2019-06-28 12:55               ` Ken Brown
2019-06-28 13:00                 ` Juanma Barranquero
2019-06-28 13:17                   ` Ken Brown
2019-06-28 13:23                     ` Juanma Barranquero
2019-06-28 17:27                       ` Ken Brown
2019-06-27 23:48   ` Stefan Monnier
2019-06-28  1:25     ` Juanma Barranquero

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=CAAeL0SQyUc-M4favEpCprmHjp6rw6dqgdBu6JpXOp03TjJRhuw@mail.gmail.com \
    --to=lekktu@gmail.com \
    --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).