summaryrefslogtreecommitdiff
path: root/lisp/shell.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-06-23 23:12:13 +0000
committerRichard M. Stallman <rms@gnu.org>1994-06-23 23:12:13 +0000
commit51bba4463fc14b6bd0cf43be99d2f70c4347d2cf (patch)
treec7b163ef29181885f522c2570743f48835752dcb /lisp/shell.el
parent552740a2f013459f5b152520cc4338d2d767be47 (diff)
downloademacs-51bba4463fc14b6bd0cf43be99d2f70c4347d2cf.tar.gz
(shell-prefixed-directory-name): Do nothing if
comint-file-name-prefix is empty. Do not inline.
Diffstat (limited to 'lisp/shell.el')
-rw-r--r--lisp/shell.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/shell.el b/lisp/shell.el
index 85db10b4fd7..8c38328b82f 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -480,12 +480,14 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(error "Couldn't popd")))))
;; Return DIR prefixed with comint-file-name-prefix as appropriate.
-(defsubst shell-prefixed-directory-name (dir)
- (if (file-name-absolute-p dir)
- ;; The name is absolute, so prepend the prefix.
- (concat comint-file-name-prefix dir)
- ;; For a relative name we assume default-directory already has the prefix.
- (expand-file-name dir)))
+(defun shell-prefixed-directory-name (dir)
+ (if (= (length comint-file-name-prefix) 0)
+ dir
+ (if (file-name-absolute-p dir)
+ ;; The name is absolute, so prepend the prefix.
+ (concat comint-file-name-prefix dir)
+ ;; For a relative name we assume default-directory already has the prefix.
+ (expand-file-name dir))))
;;; cd [dir]
(defun shell-process-cd (arg)