From 30a22664e66f8625522e734741979977c6f54e7b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 10 Jul 2007 14:47:02 -0700 Subject: [PATCH] start.exe: Put double quotes around arguments with spaces. --- programs/start/start.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/programs/start/start.c b/programs/start/start.c index 1c437fbe12d..b3a8f1cd3bb 100644 --- a/programs/start/start.c +++ b/programs/start/start.c @@ -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++ ) - p += sprintf(p, " %s", argv[i]); + { + if (strchr(argv[i], ' ')) + p += sprintf(p, " \"%s\"", argv[i]); + else + p += sprintf(p, " %s", argv[i]); + } return ret; }