summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1998-04-23 23:38:28 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1998-04-23 23:38:28 +0000
commitb1b7d3805941b5428993db76c59ef22dccecb102 (patch)
treea69c5af6481a02bfc84533b73cfb0aef7fdf28a0 /nt
parent36df52a5454f808ab3594cd5f25068e3816fc9ec (diff)
downloademacs-b1b7d3805941b5428993db76c59ef22dccecb102.tar.gz
(main): Only set environment size for real shell, and
provide extra directory argument, when running on Windows 95.
Diffstat (limited to 'nt')
-rw-r--r--nt/cmdproxy.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c
index 64eae8d286a..d7882480daf 100644
--- a/nt/cmdproxy.c
+++ b/nt/cmdproxy.c
@@ -543,7 +543,7 @@ main (int argc, char ** argv)
#else
/* Probably a mistake for there to be extra args; not fatal. */
if (argc > 0)
- warn ("warning: extra args ignored after %s\n", argv[-1]);
+ warn ("warning: extra args ignored after '%s'\n", argv[-1]);
#endif
pass_through_args[num_pass_through_args] = NULL;
@@ -578,7 +578,7 @@ main (int argc, char ** argv)
}
}
-pass_to_shell:
+ pass_to_shell:
if (need_shell)
{
char * p;
@@ -620,22 +620,32 @@ pass_to_shell:
for (argv = pass_through_args; *argv != NULL; ++argv)
p += wsprintf (p, " %s", *argv);
- /* Always set environment size to something reasonable. */
- wsprintf(p, " /e:%d /c %s", envsize, cmdline);
+ if (GetVersion () & 0x80000000)
+ /* Set environment size to something reasonable on Windows 95. */
+ wsprintf(p, " /e:%d /c %s", envsize, cmdline);
+ else
+ wsprintf(p, " /c %s", cmdline);
cmdline = buf;
}
else
{
- /* Provide dir arg expected by command.com when first started
- interactively (the "command search path"). cmd.exe does
- not require it, but accepts it silently - presumably other
- DOS compatible shells do the same. To avoid potential
- problems with spaces in command dir (which cannot be quoted
- - command.com doesn't like it), we always use the 8.3 form. */
- GetShortPathName (progname, path, sizeof (path));
- p = strrchr (path, '\\');
- /* Trailing slash is acceptable, so always leave it. */
- *(++p) = '\0';
+ if (GetVersion () & 0x80000000)
+ {
+ /* Provide dir arg expected by command.com when first
+ started interactively (the "command search path").
+ cmd.exe does not require it, but accepts it silently -
+ presumably other DOS compatible shells do the same. To
+ avoid potential problems with spaces in command dir
+ (which cannot be quoted - command.com doesn't like it),
+ we always use the 8.3 form. */
+ GetShortPathName (progname, path, sizeof (path));
+ p = strrchr (path, '\\');
+ /* Trailing slash is acceptable, so always leave it. */
+ *(++p) = '\0';
+ }
+ else
+ /* Dir arg not needed on NT. */
+ path[0] = '\0';
cmdline = p = alloca (strlen (progname) + extra_arg_space +
strlen (path) + 13);
@@ -648,9 +658,9 @@ pass_to_shell:
for (argv = pass_through_args; *argv != NULL; ++argv)
p += wsprintf (p, " %s", *argv);
- /* Always set environment size to something reasonable - again
- cmd.exe ignores this silently. */
- wsprintf (p, " /e:%d", envsize);
+ if (GetVersion () & 0x80000000)
+ /* Set environment size to something reasonable on Windows 95. */
+ wsprintf (p, " /e:%d", envsize);
}
}