emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r102406: Avoid interpreting file:/foo


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r102406: Avoid interpreting file:/foo:/bar URLs via tramp.
Date: Tue, 16 Nov 2010 14:46:12 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 102406
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Tue 2010-11-16 14:46:12 +0100
message:
  Avoid interpreting file:/foo:/bar URLs via tramp.
modified:
  lisp/url/ChangeLog
  lisp/url/url-file.el
=== modified file 'lisp/url/ChangeLog'
--- a/lisp/url/ChangeLog        2010-10-14 21:35:03 +0000
+++ b/lisp/url/ChangeLog        2010-11-16 13:46:12 +0000
@@ -1,3 +1,8 @@
+2010-11-16  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * url-file.el (url-file-build-filename): Avoid interpreting
+       file:/foo:/bar URLs via tramp.
+
 2010-10-14  Lars Magne Ingebrigtsen  <address@hidden>
 
        * url-gw.el (url-open-stream): Use open-gnutls-stream if it exists.

=== modified file 'lisp/url/url-file.el'
--- a/lisp/url/url-file.el      2010-01-13 08:35:10 +0000
+++ b/lisp/url/url-file.el      2010-11-16 13:46:12 +0000
@@ -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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]