Fixed handling of .com binaries (thanks to Chris Morgan).

This commit is contained in:
Alexandre Julliard 2002-07-23 21:02:31 +00:00
parent 2f61c4a1b3
commit 75ce72ea44
1 changed files with 11 additions and 3 deletions

View File

@ -1104,6 +1104,7 @@ BOOL WINAPI CreateProcessA( LPCSTR app_name, LPSTR cmd_line, LPSECURITY_ATTRIBUT
DOS_FULL_NAME full_dir;
char name[MAX_PATH];
LPSTR tidy_cmdline;
char *p;
/* Process the AppName and/or CmdLine to get module name and path */
@ -1202,11 +1203,18 @@ BOOL WINAPI CreateProcessA( LPCSTR app_name, LPSTR cmd_line, LPSECURITY_ATTRIBUT
retv = create_process( hFile, name, tidy_cmdline, env, process_attr, thread_attr,
inherit, flags, startup_info, info, unixdir );
break;
case BINARY_UNIX_EXE:
case BINARY_UNKNOWN:
/* check for .com extension */
if ((p = strrchr( name, '.' )) && !FILE_strcasecmp( p, ".com" ))
{
TRACE( "starting %s as DOS binary\n", debugstr_a(name) );
retv = create_process( hFile, name, tidy_cmdline, env, process_attr, thread_attr,
inherit, flags, startup_info, info, unixdir );
break;
}
/* fall through */
case BINARY_UNIX_EXE:
{
/* unknown file, try as unix executable */
DOS_FULL_NAME full_name;
const char *unixfilename = name;