aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-24 19:40:24 +0000
committerRichard M. Stallman1996-09-24 19:40:24 +0000
commita878555182908d9daa090e5c61ff95147c2b9df4 (patch)
treebacbb693ae8230773df9f428dcca97b200878023 /src
parentea3165c72358ff434adf7774ab900090c6fa000e (diff)
downloademacs-a878555182908d9daa090e5c61ff95147c2b9df4.tar.gz
emacs-a878555182908d9daa090e5c61ff95147c2b9df4.zip
(run_msdos_command): When testing whether a shell
belongs to the MSDOS family, convert its name to lower-case.
Diffstat (limited to 'src')
-rw-r--r--src/msdos.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 99695db3329..2f19901a20f 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -2682,7 +2682,7 @@ run_msdos_command (argv, dir, tempin, tempout, temperr)
2682 Lisp_Object dir; 2682 Lisp_Object dir;
2683 int tempin, tempout, temperr; 2683 int tempin, tempout, temperr;
2684{ 2684{
2685 char *saveargv1, *saveargv2, **envv; 2685 char *saveargv1, *saveargv2, **envv, *lowcase_argv0, *pa, *pl;
2686 char oldwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */ 2686 char oldwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */
2687 int msshell, result = -1; 2687 int msshell, result = -1;
2688 int in, out, inbak, outbak, errbak; 2688 int in, out, inbak, outbak, errbak;
@@ -2692,7 +2692,19 @@ run_msdos_command (argv, dir, tempin, tempout, temperr)
2692 /* Get current directory as MSDOS cwd is not per-process. */ 2692 /* Get current directory as MSDOS cwd is not per-process. */
2693 getwd (oldwd); 2693 getwd (oldwd);
2694 2694
2695 cmd = Ffile_name_nondirectory (build_string (argv[0])); 2695 /* If argv[0] is the shell, it might come in any lettercase.
2696 Since `Fmember' is case-sensitive, we need to downcase
2697 argv[0], even if we are on case-preserving filesystems. */
2698 lowcase_argv0 = alloca (strlen (argv[0]) + 1);
2699 for (pa = argv[0], pl = lowcase_argv0; *pa; pl++)
2700 {
2701 *pl = *pa++;
2702 if (*pl >= 'A' && *pl <= 'Z')
2703 *pl += 'a' - 'A';
2704 }
2705 *pl = '\0';
2706
2707 cmd = Ffile_name_nondirectory (build_string (lowcase_argv0));
2696 msshell = !NILP (Fmember (cmd, Fsymbol_value (intern ("msdos-shells")))) 2708 msshell = !NILP (Fmember (cmd, Fsymbol_value (intern ("msdos-shells"))))
2697 && !strcmp ("-c", argv[1]); 2709 && !strcmp ("-c", argv[1]);
2698 if (msshell) 2710 if (msshell)