Skip quoted program name when building command line.

This commit is contained in:
Alexandre Julliard 2000-07-31 21:02:53 +00:00
parent 128843046d
commit 15aef00f29
1 changed files with 5 additions and 2 deletions

View File

@ -295,6 +295,9 @@ BOOL TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cmdline,
if (!cmdline)
{
cmdline = pdb32->env_db->cmd_line;
/* remove the first word (program name) */
if (*cmdline == '"')
if (!(cmdline = strchr( cmdline+1, '"' ))) cmdline = pdb32->env_db->cmd_line;
while (*cmdline && (*cmdline != ' ') && (*cmdline != '\t')) cmdline++;
while ((*cmdline == ' ') || (*cmdline == '\t')) cmdline++;
len = strlen(cmdline);
@ -304,6 +307,8 @@ BOOL TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cmdline,
memcpy( pTask->pdb.cmdLine + 1, cmdline, len );
/* pTask->pdb.cmdLine[len+1] = 0; */
TRACE("module='%s' cmdline='%.*s' task=%04x\n", name, len, cmdline, hTask );
/* Get the compatibility flags */
pTask->compat_flags = GetProfileIntA( "Compatibility", name, 0 );
@ -336,8 +341,6 @@ BOOL TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cmdline,
teb->htask16 = hTask;
if (!initial_task) initial_task = hTask;
TRACE("module='%s' cmdline='%.*s' task=%04x\n", name, *cmdline, cmdline+1, hTask );
/* Add the task to the linked list */
SYSLEVEL_EnterWin16Lock();