]> code.delx.au - gnu-emacs/commitdiff
Fix Bug#20821
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 1 Feb 2016 10:48:43 +0000 (11:48 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 1 Feb 2016 10:48:43 +0000 (11:48 +0100)
* 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)

lisp/net/tramp-sh.el
lisp/net/tramp.el

index 7e0b13ddf006c3a228bbea3f7b8b86249f10ba7f..8d01a4b2120d32ac89c9e5360a121e53e382d0d5 100644 (file)
@@ -497,7 +497,7 @@ The string is used in `tramp-methods'.")
 ;; "getconf PATH" yields:
 ;; HP-UX: /usr/bin:/usr/ccs/bin:/opt/ansic/bin:/opt/langtools/bin:/opt/fortran/bin
 ;; Solaris: /usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin
-;; GNU/Linux (Debian, Suse): /bin:/usr/bin
+;; GNU/Linux (Debian, Suse, RHEL): /bin:/usr/bin
 ;; FreeBSD: /usr/bin:/bin:/usr/sbin:/sbin: - beware trailing ":"!
 ;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin
 ;; IRIX64: /usr/bin
@@ -2797,7 +2797,7 @@ The method used must be an out-of-band method."
          (narrow-to-region (point) (point))
          ;; We cannot use `insert-buffer-substring' because the Tramp
          ;; buffer changes its contents before insertion due to calling
-         ;; `expand-file' and alike.
+         ;; `expand-file-name' and alike.
          (insert
           (with-current-buffer (tramp-get-buffer v)
             (buffer-string)))
@@ -2860,9 +2860,10 @@ the result will be a local, non-Tramp, file name."
   ;; Unless NAME is absolute, concat DIR and NAME.
   (unless (file-name-absolute-p name)
     (setq name (concat (file-name-as-directory dir) name)))
-  ;; If NAME is not a Tramp file, run the real handler.
+  ;; If connection is not established yet, run the real handler.
   (if (not (tramp-connectable-p name))
-      (tramp-run-real-handler 'expand-file-name (list name nil))
+      (tramp-drop-volume-letter
+       (tramp-run-real-handler 'expand-file-name (list name nil)))
     ;; Dissect NAME.
     (with-parsed-tramp-file-name name nil
       (unless (tramp-run-real-handler 'file-name-absolute-p (list localname))
index 6d8ea021ef3f37c619a7e736fd3f2d13538d2008..3b8510ede4887f7cb8f585ecbea581d18e25392d 100644 (file)
@@ -1987,13 +1987,13 @@ Falls back to normal file name handler if no Tramp file name handler exists."
                (tramp-replace-environment-variables
                 (apply 'tramp-file-name-for-operation operation args)))
               (completion (tramp-completion-mode-p))
-              (foreign (tramp-find-foreign-file-name-handler filename)))
+              (foreign (tramp-find-foreign-file-name-handler filename))
+              result)
          (with-parsed-tramp-file-name filename nil
            ;; Call the backend function.
            (if foreign
                (tramp-condition-case-unless-debug err
-                   (let ((sf (symbol-function foreign))
-                         result)
+                   (let ((sf (symbol-function foreign)))
                      ;; Some packages set the default directory to a
                      ;; remote path, before respective Tramp packages
                      ;; are already loaded.  This results in
@@ -2057,8 +2057,13 @@ Falls back to normal file name handler if no Tramp file name handler exists."
                    ;; Propagate the error.
                    (t (signal (car err) (cdr err))))))
 
-             ;; Nothing to do for us.
-             (tramp-run-real-handler operation args)))))
+             ;; Nothing to do for us.  However, since we are in
+             ;; `tramp-mode', we must suppress the volume letter on
+             ;; MS Windows.
+             (setq result (tramp-run-real-handler operation args))
+             (if (stringp result)
+                 (tramp-drop-volume-letter result)
+               result)))))
 
     ;; When `tramp-mode' is not enabled, we don't do anything.
     (tramp-run-real-handler operation args)))