diff options
author | wtc%google.com <devnull@localhost> | 2008-01-20 07:13:54 +0000 |
---|---|---|
committer | wtc%google.com <devnull@localhost> | 2008-01-20 07:13:54 +0000 |
commit | 6694b800bda867f89e356829286d27649b435903 (patch) | |
tree | 760c02c5a6ec1802196d9b416662385d9532bbde | |
parent | cc002c4498d2d3c3c2337956d4b7b86e206d6ac1 (diff) | |
download | nspr-hg-6694b800bda867f89e356829286d27649b435903.tar.gz |
Bug 333637: assembleCmdLine needs to quote an empty-string argument. TheNSPR_HEAD_20080120
patch is contributed by Aleksey Sanin <aleksey@aleksey.com>. r=wtc
-rw-r--r-- | pr/src/md/windows/ntmisc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pr/src/md/windows/ntmisc.c b/pr/src/md/windows/ntmisc.c index 7cb5b3cb..67c970f3 100644 --- a/pr/src/md/windows/ntmisc.c +++ b/pr/src/md/windows/ntmisc.c @@ -147,8 +147,11 @@ static int assembleCmdLine(char *const *argv, char **cmdLine) numBackslashes = 0; argNeedQuotes = 0; - /* If the argument contains white space, it needs to be quoted. */ - if (strpbrk(*arg, " \f\n\r\t\v")) { + /* + * If the argument is empty or contains white space, it needs to + * be quoted. + */ + if (**arg == '\0' || strpbrk(*arg, " \f\n\r\t\v")) { argNeedQuotes = 1; } |