]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid interpreting file:/foo:/bar URLs via tramp.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 16 Nov 2010 13:46:12 +0000 (14:46 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 16 Nov 2010 13:46:12 +0000 (14:46 +0100)
lisp/url/ChangeLog
lisp/url/url-file.el

index 4ef2b42756bcf490d196543a8d78e76614f0248a..69a6746cee12ec697d336c48e66932672cd393df 100644 (file)
@@ -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.
index 4e86c653c8cfb4eeac248ca26de8154f12a76f12..22d74b3371bfa558a588236963cd7088fbb8d50e 100644 (file)
@@ -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