summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2008-01-20 07:13:54 +0000
committerwtc%google.com <devnull@localhost>2008-01-20 07:13:54 +0000
commit6694b800bda867f89e356829286d27649b435903 (patch)
tree760c02c5a6ec1802196d9b416662385d9532bbde
parentcc002c4498d2d3c3c2337956d4b7b86e206d6ac1 (diff)
downloadnspr-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.c7
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;
}