summaryrefslogtreecommitdiff
path: root/lisp/url
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen <larsi@gnus.org>2010-11-16 14:46:12 +0100
committerLars Magne Ingebrigtsen <larsi@gnus.org>2010-11-16 14:46:12 +0100
commit023ec128fd95eadac7b607177969267cc8b9accf (patch)
tree2b3203369be417d985e75e192c948f56ed714140 /lisp/url
parentd2762c86419d6d55bf59fd62ea1c9fa3525411c0 (diff)
downloademacs-023ec128fd95eadac7b607177969267cc8b9accf.tar.gz
Avoid interpreting file:/foo:/bar URLs via tramp.
Diffstat (limited to 'lisp/url')
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-file.el19
2 files changed, 18 insertions, 6 deletions
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 4ef2b42756b..69a6746cee1 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * url-file.el (url-file-build-filename): Avoid interpreting
+ file:/foo:/bar URLs via tramp.
+
2010-10-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
* url-gw.el (url-open-stream): Use open-gnutls-stream if it exists.
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index 4e86c653c8c..22d74b3371b 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -103,12 +103,19 @@ to them."
(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