changeset 21925:3e498c36ccce

(sh-shell-file): If $SHELL evaluates to one of MS-DOS or MS-Windows shells, use "bin/sh" instead.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 03 May 1998 15:57:33 +0000
parents e37aa6f8f583
children 76061e1fa136
files lisp/progmodes/sh-script.el
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el	Sun May 03 08:24:36 1998 +0000
+++ b/lisp/progmodes/sh-script.el	Sun May 03 15:57:33 1998 +0000
@@ -128,7 +128,16 @@
    ;; the executable extension, so comparisons with the list of
    ;; known shells work.
    (and (memq system-type '(ms-dos windows-nt))
-	(file-name-sans-extension (downcase (getenv "SHELL"))))
+	(let* ((shell (getenv "SHELL"))
+	       (shell-base
+		(and shell (file-name-nondirectory shell))))
+	  ;; shell-script mode doesn't support DOS/Windows shells,
+	  ;; so use the default instead.
+	  (if (or (null shell)
+		  (member (downcase shell-base)
+			  '("command.com" "cmd.exe" "4dos.com" "ndos.com")))
+	      "/bin/sh"
+	    (file-name-sans-extension (downcase shell)))))
    (getenv "SHELL")
    "/bin/sh")
   "*The executable file name for the shell being programmed."