aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii1998-05-03 15:57:33 +0000
committerEli Zaretskii1998-05-03 15:57:33 +0000
commiteee86eff468db2c025132133ddfce39c30dd65d0 (patch)
tree9d5db891943f127aa32e2d73c9a1b40104b12be4
parent7ab2c2894c895f290ac56c7f0aaf903e1e4ff9df (diff)
downloademacs-eee86eff468db2c025132133ddfce39c30dd65d0.tar.gz
emacs-eee86eff468db2c025132133ddfce39c30dd65d0.zip
(sh-shell-file): If $SHELL evaluates to
one of MS-DOS or MS-Windows shells, use "bin/sh" instead.
-rw-r--r--lisp/progmodes/sh-script.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 508a9abaf4e..c30d2220269 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -128,7 +128,16 @@ shell it really is."
128 ;; the executable extension, so comparisons with the list of 128 ;; the executable extension, so comparisons with the list of
129 ;; known shells work. 129 ;; known shells work.
130 (and (memq system-type '(ms-dos windows-nt)) 130 (and (memq system-type '(ms-dos windows-nt))
131 (file-name-sans-extension (downcase (getenv "SHELL")))) 131 (let* ((shell (getenv "SHELL"))
132 (shell-base
133 (and shell (file-name-nondirectory shell))))
134 ;; shell-script mode doesn't support DOS/Windows shells,
135 ;; so use the default instead.
136 (if (or (null shell)
137 (member (downcase shell-base)
138 '("command.com" "cmd.exe" "4dos.com" "ndos.com")))
139 "/bin/sh"
140 (file-name-sans-extension (downcase shell)))))
132 (getenv "SHELL") 141 (getenv "SHELL")
133 "/bin/sh") 142 "/bin/sh")
134 "*The executable file name for the shell being programmed." 143 "*The executable file name for the shell being programmed."