# HG changeset patch # User Lars Magne Ingebrigtsen # Date 1289915172 -3600 # Node ID 7ac0fe73f41de3ea1869c3a946c630a1d94aec22 # Parent a673d202fe464fc5a53f0602970b7c89775d088e Avoid interpreting file:/foo:/bar URLs via tramp. diff -r a673d202fe46 -r 7ac0fe73f41d lisp/url/ChangeLog --- a/lisp/url/ChangeLog Mon Nov 15 22:44:51 2010 -0800 +++ b/lisp/url/ChangeLog Tue Nov 16 14:46:12 2010 +0100 @@ -1,3 +1,8 @@ +2010-11-16 Lars Magne Ingebrigtsen + + * url-file.el (url-file-build-filename): Avoid interpreting + file:/foo:/bar URLs via tramp. + 2010-10-14 Lars Magne Ingebrigtsen * url-gw.el (url-open-stream): Use open-gnutls-stream if it exists. diff -r a673d202fe46 -r 7ac0fe73f41d lisp/url/url-file.el --- a/lisp/url/url-file.el Mon Nov 15 22:44:51 2010 -0800 +++ b/lisp/url/url-file.el Tue Nov 16 14:46:12 2010 +0100 @@ -103,12 +103,19 @@ (format "%s#%d" host port)) host)) (file (url-unhex-string (url-filename url))) - (filename (if (or user (not (url-file-host-is-local-p host))) - (concat "/" (or user "anonymous") "@" site ":" file) - (if (and (memq system-type '(ms-dos windows-nt)) - (string-match "^/[a-zA-Z]:/" file)) - (substring file 1) - file))) + (filename (cond + ;; ftp: URL. + ((or user (not (url-file-host-is-local-p host))) + (concat "/" (or user "anonymous") "@" site ":" file)) + ;; file: URL on Windows. + ((and (string-match "\\`/[a-zA-Z]:/" file) + (memq system-type '(ms-dos windows-nt))) + (substring file 1)) + ;; file: URL with a file:/bar:/foo-like spec. + ((string-match "\\`/[^/]+:/" file) + (concat "/:" file)) + (t + file))) pos-index) (and user pass