start.exe: Put double quotes around arguments with spaces.

This commit is contained in:
Lei Zhang 2007-07-10 14:47:02 -07:00 committed by Alexandre Julliard
parent 5db70db76e
commit 30a22664e6
1 changed files with 10 additions and 1 deletions

View File

@ -107,12 +107,21 @@ static char *build_args( int argc, char **argv )
char *ret, *p;
for (i = 0; i < argc; i++ )
{
len += strlen(argv[i]) + 1;
if (strchr(argv[i], ' '))
len += 2;
}
ret = HeapAlloc( GetProcessHeap(), 0, len );
ret[0] = 0;
for (i = 0, p = ret; i < argc; i++ )
{
if (strchr(argv[i], ' '))
p += sprintf(p, " \"%s\"", argv[i]);
else
p += sprintf(p, " %s", argv[i]);
}
return ret;
}