Module: wine Branch: master Commit: 30a22664e66f8625522e734741979977c6f54e7b URL: http://source.winehq.org/git/wine.git/?a=commit;h=30a22664e66f8625522e734741...
Author: Lei Zhang thestig@google.com Date: Tue Jul 10 14:47:02 2007 -0700
start.exe: Put double quotes around arguments with spaces.
---
programs/start/start.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/programs/start/start.c b/programs/start/start.c index 1c437fb..b3a8f1c 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; }