From 03ef8f3f342508771e5815c2c946339491de9071 Mon Sep 17 00:00:00 2001 From: stanton Date: Mon, 15 Jun 1998 19:09:09 +0000 Subject: added code to handle null arguments --- win/tclWinPipe.c | 16 +++++++++++----- 1 file 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]; ; ) { -- cgit v0.12