summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]; ; ) {