summaryrefslogtreecommitdiff
path: root/src/msdos.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-24 19:40:24 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-24 19:40:24 +0000
commit947487bf72319dfaecc05741ab22e2542fa800e3 (patch)
tree25728eba145962a15049b045c9a2139274ef9d56 /src/msdos.c
parent03ed07e956816e2afec2000aa834002e29bdee31 (diff)
downloademacs-947487bf72319dfaecc05741ab22e2542fa800e3.tar.gz
(run_msdos_command): When testing whether a shell
belongs to the MSDOS family, convert its name to lower-case.
Diffstat (limited to 'src/msdos.c')
-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)
Lisp_Object dir;
int tempin, tempout, temperr;
{
- char *saveargv1, *saveargv2, **envv;
+ char *saveargv1, *saveargv2, **envv, *lowcase_argv0, *pa, *pl;
char oldwd[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */
int msshell, result = -1;
int in, out, inbak, outbak, errbak;
@@ -2692,7 +2692,19 @@ run_msdos_command (argv, dir, tempin, tempout, temperr)
/* Get current directory as MSDOS cwd is not per-process. */
getwd (oldwd);
- cmd = Ffile_name_nondirectory (build_string (argv[0]));
+ /* If argv[0] is the shell, it might come in any lettercase.
+ Since `Fmember' is case-sensitive, we need to downcase
+ argv[0], even if we are on case-preserving filesystems. */
+ lowcase_argv0 = alloca (strlen (argv[0]) + 1);
+ for (pa = argv[0], pl = lowcase_argv0; *pa; pl++)
+ {
+ *pl = *pa++;
+ if (*pl >= 'A' && *pl <= 'Z')
+ *pl += 'a' - 'A';
+ }
+ *pl = '\0';
+
+ cmd = Ffile_name_nondirectory (build_string (lowcase_argv0));
msshell = !NILP (Fmember (cmd, Fsymbol_value (intern ("msdos-shells"))))
&& !strcmp ("-c", argv[1]);
if (msshell)