Cygwin: spawn: drop special handling for cmd.exe and command.com

Apparently at one point handling cmd.exe and command.com special
made sense, but what that should be has never been documented.
There's also no clear reason why cmd.exe is different from any
other native executable.  Additionaly, checking for command.com
is entirely useless on 64 bit Windows anyway.

Just drop this code.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-10-28 12:24:13 +02:00
parent 85148c43c4
commit f33635ae60
1 changed files with 47 additions and 73 deletions

View File

@ -345,7 +345,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
PWCHAR runpath = tp.w_get ();
int c_flags;
bool null_app_name = false;
STARTUPINFOW si = {};
int looped = 0;
@ -397,25 +396,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
__leave;
}
if (ac == 3 && argv[1][0] == '/' && tolower (argv[1][1]) == 'c' &&
(iscmd (argv[0], "command.com") || iscmd (argv[0], "cmd.exe")))
{
real_path.check (prog_arg);
cmd.add ("\"");
if (!real_path.error)
cmd.add (real_path.get_win32 ());
else
cmd.add (argv[0]);
cmd.add ("\"");
cmd.add (" ");
cmd.add (argv[1]);
cmd.add (" ");
cmd.add (argv[2]);
real_path.set_path (argv[0]);
null_app_name = true;
}
else
{
if (real_path.iscygexec ())
{
moreinfo->argc = newargv.argc;
@ -437,7 +417,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
moreinfo->myself_pinfo = NULL;
else
VerifyHandle (moreinfo->myself_pinfo);
}
PROCESS_INFORMATION pi;
pi.hProcess = pi.hThread = NULL;
@ -507,10 +486,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
}
}
if (null_app_name)
runpath = NULL;
else
{
USHORT len = real_path.get_nt_native_path ()->Length / sizeof (WCHAR);
if (RtlEqualUnicodePathPrefix (real_path.get_nt_native_path (),
&ro_u_natp, FALSE))
@ -543,7 +518,6 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
res = -1;
__leave;
}
}
cygbench ("spawn-worker");