aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2016-02-01 11:48:43 +0100
committerMichael Albinus2016-02-01 11:48:43 +0100
commitc5f466db6f6b8196b8429db8bb7b74f8090d5d3e (patch)
treeac58bdb0720846440d374aa95b1c6c4e23d4d2e0
parentec3b436f18a120415b4ab45690347002cec4d831 (diff)
downloademacs-c5f466db6f6b8196b8429db8bb7b74f8090d5d3e.tar.gz
emacs-c5f466db6f6b8196b8429db8bb7b74f8090d5d3e.zip
Fix Bug#20821
* lisp/net/tramp.el (tramp-file-name-handler): * lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name): Use `tramp-drop-volume-letter'. (Bug#20821)
-rw-r--r--lisp/net/tramp-sh.el9
-rw-r--r--lisp/net/tramp.el15
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 7e0b13ddf00..8d01a4b2120 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -497,7 +497,7 @@ The string is used in `tramp-methods'.")
497;; "getconf PATH" yields: 497;; "getconf PATH" yields:
498;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin 498;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin
499;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin 499;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin
500;; GNU/Linux (Debian, Suse): /bin:/usr/bin 500;; GNU/Linux (Debian, Suse, RHEL): /bin:/usr/bin
501;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"! 501;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"!
502;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin 502;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin
503;; IRIX64: /usr/bin 503;; IRIX64: /usr/bin
@@ -2797,7 +2797,7 @@ The method used must be an out-of-band method."
2797 (narrow-to-region (point) (point)) 2797 (narrow-to-region (point) (point))
2798 ;; We cannot use `insert-buffer-substring' because the Tramp 2798 ;; We cannot use `insert-buffer-substring' because the Tramp
2799 ;; buffer changes its contents before insertion due to calling 2799 ;; buffer changes its contents before insertion due to calling
2800 ;; `expand-file' and alike. 2800 ;; `expand-file-name' and alike.
2801 (insert 2801 (insert
2802 (with-current-buffer (tramp-get-buffer v) 2802 (with-current-buffer (tramp-get-buffer v)
2803 (buffer-string))) 2803 (buffer-string)))
@@ -2860,9 +2860,10 @@ the result will be a local, non-Tramp, file name."
2860 ;; Unless NAME is absolute, concat DIR and NAME. 2860 ;; Unless NAME is absolute, concat DIR and NAME.
2861 (unless (file-name-absolute-p name) 2861 (unless (file-name-absolute-p name)
2862 (setq name (concat (file-name-as-directory dir) name))) 2862 (setq name (concat (file-name-as-directory dir) name)))
2863 ;; If NAME is not a Tramp file, run the real handler. 2863 ;; If connection is not established yet, run the real handler.
2864 (if (not (tramp-connectable-p name)) 2864 (if (not (tramp-connectable-p name))
2865 (tramp-run-real-handler 'expand-file-name (list name nil)) 2865 (tramp-drop-volume-letter
2866 (tramp-run-real-handler 'expand-file-name (list name nil)))
2866 ;; Dissect NAME. 2867 ;; Dissect NAME.
2867 (with-parsed-tramp-file-name name nil 2868 (with-parsed-tramp-file-name name nil
2868 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) 2869 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 6d8ea021ef3..3b8510ede48 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1987,13 +1987,13 @@ Falls back to normal file name handler if no Tramp file name handler exists."
1987 (tramp-replace-environment-variables 1987 (tramp-replace-environment-variables
1988 (apply 'tramp-file-name-for-operation operation args))) 1988 (apply 'tramp-file-name-for-operation operation args)))
1989 (completion (tramp-completion-mode-p)) 1989 (completion (tramp-completion-mode-p))
1990 (foreign (tramp-find-foreign-file-name-handler filename))) 1990 (foreign (tramp-find-foreign-file-name-handler filename))
1991 result)
1991 (with-parsed-tramp-file-name filename nil 1992 (with-parsed-tramp-file-name filename nil
1992 ;; Call the backend function. 1993 ;; Call the backend function.
1993 (if foreign 1994 (if foreign
1994 (tramp-condition-case-unless-debug err 1995 (tramp-condition-case-unless-debug err
1995 (let ((sf (symbol-function foreign)) 1996 (let ((sf (symbol-function foreign)))
1996 result)
1997 ;; Some packages set the default directory to a 1997 ;; Some packages set the default directory to a
1998 ;; remote path, before respective Tramp packages 1998 ;; remote path, before respective Tramp packages
1999 ;; are already loaded. This results in 1999 ;; are already loaded. This results in
@@ -2057,8 +2057,13 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2057 ;; Propagate the error. 2057 ;; Propagate the error.
2058 (t (signal (car err) (cdr err)))))) 2058 (t (signal (car err) (cdr err))))))
2059 2059
2060 ;; Nothing to do for us. 2060 ;; Nothing to do for us. However, since we are in
2061 (tramp-run-real-handler operation args))))) 2061 ;; `tramp-mode', we must suppress the volume letter on
2062 ;; MS Windows.
2063 (setq result (tramp-run-real-handler operation args))
2064 (if (stringp result)
2065 (tramp-drop-volume-letter result)
2066 result)))))
2062 2067
2063 ;; When `tramp-mode' is not enabled, we don't do anything. 2068 ;; When `tramp-mode' is not enabled, we don't do anything.
2064 (tramp-run-real-handler operation args))) 2069 (tramp-run-real-handler operation args)))