summaryrefslogtreecommitdiffstats
path: root/win/tclWinPipe.c
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-05-10 19:00:46 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-05-10 19:00:46 (GMT)
commitd8e1314396cd67bc55133079c23317692ae14e1c (patch)
treea471711835f34632db702bc5c4b22fb923165f5a /win/tclWinPipe.c
parentdcfb7eb50004e70e51aa0a6ba2f3b4c88a52872b (diff)
downloadtcl-d8e1314396cd67bc55133079c23317692ae14e1c.zip
tcl-d8e1314396cd67bc55133079c23317692ae14e1c.tar.gz
tcl-d8e1314396cd67bc55133079c23317692ae14e1c.tar.bz2
(BuildCommandLine): Moved non-obvious appending logic to outside the loop
and added commentary for its purpose.
Diffstat (limited to 'win/tclWinPipe.c')
-rw-r--r--win/tclWinPipe.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 37d6cce..2e26bee 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinPipe.c,v 1.44 2004/05/08 03:48:37 chengyemao Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.45 2004/05/10 19:00:46 davygrvy Exp $
*/
#include "tclWinInt.h"
@@ -1571,20 +1571,21 @@ BuildCommandLine(
Tcl_DStringInit(&ds);
/*
- * Prime the path.
+ * Prime the path. Add a space separator if we were primed with
+ * something.
*/
-
+
Tcl_DStringAppend(&ds, Tcl_DStringValue(linePtr), -1);
-
+ if (Tcl_DStringLength(&ds) > 0) Tcl_DStringAppend(&ds, " ", 1);
+
for (i = 0; i < argc; i++) {
if (i == 0) {
arg = executable;
} else {
arg = argv[i];
+ Tcl_DStringAppend(&ds, " ", 1);
}
- if(Tcl_DStringLength(&ds) > 0) Tcl_DStringAppend(&ds, " ", 1);
-
quote = 0;
if (arg[0] == '\0') {
quote = 1;