From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#6339: url-filename => "/c:/some/file.txt" Date: Thu, 22 Sep 2011 00:21:03 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1316643779 25499 80.91.229.12 (21 Sep 2011 22:22:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Sep 2011 22:22:59 +0000 (UTC) Cc: 6339@debbugs.gnu.org To: Lars Magne Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 22 00:22:55 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VBv-0003dq-IB for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Sep 2011 00:22:55 +0200 Original-Received: from localhost ([::1]:58728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VBu-0004Vo-TZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Sep 2011 18:22:54 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VBp-0004VD-ML for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:22:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6VBl-0000Um-G4 for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:22:49 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6VBl-0000Ug-D4 for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:22:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R6VC1-00033F-Nl for bug-gnu-emacs@gnu.org; Wed, 21 Sep 2011 18:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Sep 2011 22:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6339 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6339-submit@debbugs.gnu.org id=B6339.131664372311661 (code B ref 6339); Wed, 21 Sep 2011 22:23:01 +0000 Original-Received: (at 6339) by debbugs.gnu.org; 21 Sep 2011 22:22:03 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VB5-000322-L4 for submit@debbugs.gnu.org; Wed, 21 Sep 2011 18:22:03 -0400 Original-Received: from mail-gx0-f172.google.com ([209.85.161.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R6VB3-00031d-4z for 6339@debbugs.gnu.org; Wed, 21 Sep 2011 18:22:02 -0400 Original-Received: by gxk19 with SMTP id 19so1585472gxk.3 for <6339@debbugs.gnu.org>; Wed, 21 Sep 2011 15:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=F94Dnazu9ntAM64+AzsarcAkDvsh1jFEkkdwwHJaRgM=; b=E0cvBD01wUhdoYyQzZmnEGiggnQoTQ6yK0vruFkacZEC63aU2tp3oQUKED2NeoUnQV JSBzTEu/9o6CmyGB/36CJwxNzIwP0UyGzs4sS/Z2yxb+gJUrDD8r04ZCyeYJuJidGHOs z6OcUp+5RGB5B3ZaQI5FpuF7mJCYJK3l5ZUr4= Original-Received: by 10.42.130.193 with SMTP id w1mr837087ics.176.1316643703350; Wed, 21 Sep 2011 15:21:43 -0700 (PDT) Original-Received: by 10.142.223.13 with HTTP; Wed, 21 Sep 2011 15:21:03 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 21 Sep 2011 18:23:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:51617 Archived-At: On Wed, Sep 21, 2011 at 22:28, Lars Magne Ingebrigtsen wro= te: > If I say: > > (setq x (url-generic-parse-url "file:///home/larsi/foo.txt")) > > Then I get > > (url-filename x) > =3D> "/home/larsi/foo.txt" > > as expected. =C2=A0Would your patch break that? My patch would return "home/larsi/foo.txt", yes. But expecting the slash is a "bug" in you expectations, because the *filename* (the path, according to the RFCs, see below) of file:///home/larsi/foo.txt is not "/home/larsi/foo.txt". The slash is a separator, part of the URI syntax, and "home/larsi/foo.txt" is an absolute path. It's easier to see it with the full syntax, in things like file://localhost/home/larsi/foo.txt for example. The fact that url-filename returns the slash is a bug; just one that nobody has fixed or complained about because it makes easier to process the path than having to do (concat "/" (url-filename "file:///mypath")) At least, until you have a Windows URI. And no, this is *not* a Windows problem or a Windows bug, it's a bug that makes life easier for POSIX at the cost of making it uglier for Windows. =C2=A0 =C2=A0 Juanma >From RFC 1738 "Uniform Resource Locators (URL)" 3.10 FILES The file URL scheme is used to designate files accessible on a particular host computer. This scheme, unlike most other URL schemes, does not designate a resource that is universally accessible over the Internet. A file URL takes the form: file:/// where is the fully qualified domain name of the system on which the is accessible, and is a hierarchical directory path of the form //.../. For example, a VMS file DISK$USER:[MY.NOTES]NOTE123456.TXT might become As a special case, can be the string "localhost" or the empty string; this is interpreted as `the machine from which the URL is being interpreted'. The file URL scheme is unusual in that it does not specify an Internet protocol or access method for such files; as such, its utility in network protocols between hosts is limited.