;; "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
(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)))
;; 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))
(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
;; 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)))