summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1998-06-15 19:09:09 (GMT)
committerstanton <stanton>1998-06-15 19:09:09 (GMT)
commit03ef8f3f342508771e5815c2c946339491de9071 (patch)
tree16845bbe92ae1a7a8ca1bf17eaedd3e4b1a0c961
parent985075957218d62ac8716679d6eabe95351fcd37 (diff)
downloadtcl-03ef8f3f342508771e5815c2c946339491de9071.zip
tcl-03ef8f3f342508771e5815c2c946339491de9071.tar.gz
tcl-03ef8f3f342508771e5815c2c946339491de9071.tar.bz2
added code to handle null arguments
-rw-r--r--win/tclWinPipe.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index a7aeaf4..7e2e7bc 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -1561,13 +1561,19 @@ BuildCommandLine(argc, argv, linePtr)
}
quote = 0;
- for (start = argv[i]; *start != '\0'; start++) {
- if (isspace(*start)) {
- quote = 1;
- Tcl_DStringAppend(linePtr, "\"", 1);
- break;
+ if (argv[i][0] == '\0') {
+ quote = 1;
+ } else {
+ for (start = argv[i]; *start != '\0'; start++) {
+ if (isspace(*start)) {
+ quote = 1;
+ break;
+ }
}
}
+ if (quote) {
+ Tcl_DStringAppend(linePtr, "\"", 1);
+ }
start = argv[i];
for (special = argv[i]; ; ) {