From 2033b64487aee42c8bfeca4dcdc05443f424ab6c Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Mon, 17 Jun 2002 20:05:49 +0000 Subject: * win/tclWinPipe.c (BuildCommandLine): Fixed bug #554068 ([exec] on windows did not treat { in filenames well.). Bug reported by Vince Darley , patch provided by Vince too. FossilOrigin-Name: 2c091448504829060f054ce6a932215b2aec04c4 --- ChangeLog | 7 +++++++ tests/exec.test | 12 +++++++++++- win/tclWinPipe.c | 7 ++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 089f1d6..2d7ac54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-06-17 Andreas Kupries + + * win/tclWinPipe.c (BuildCommandLine): Fixed bug #554068 ([exec] + on windows did not treat { in filenames well.). Bug reported by + Vince Darley , patch + provided by Vince too. + 2002-06-17 Joe English * generic/tcl.h: #ifdef logic for K&R C backwards compatibility diff --git a/tests/exec.test b/tests/exec.test index 9087173..9ead9ce 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: exec.test,v 1.9 2001/11/23 01:26:02 das Exp $ +# RCS: @(#) $Id: exec.test,v 1.10 2002/06/17 20:05:49 andreas_kupries Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -586,6 +586,16 @@ test exec-17.1 { inheriting standard I/O } {execCommandExists stdio} { } {{foobar }} +test exec-18.1 { exec cat deals with weird file names} {execCommandExists} { + set f "foo\[\{blah" + set fout [open $f w] + puts $fout "contents" + close $fout + set res [list [catch {exec cat $f} msg] $msg] + file delete $f + set res +} {0 contents} + # cleanup file delete script gorp.file gorp.file2 file delete echo cat wc sh sleep exit diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index d20aa3d..b02bb3b 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.24 2002/03/24 11:41:51 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinPipe.c,v 1.25 2002/06/17 20:05:49 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -1592,6 +1592,11 @@ BuildCommandLine( Tcl_DStringAppend(&ds, "\\\"", 2); start = special + 1; } + if (*special == '{') { + Tcl_DStringAppend(&ds, start, special - start); + Tcl_DStringAppend(&ds, "\\{", 2); + start = special + 1; + } if (*special == '\0') { break; } -- cgit v0.12