diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2002-06-17 20:05:49 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2002-06-17 20:05:49 (GMT) |
commit | 2033b64487aee42c8bfeca4dcdc05443f424ab6c (patch) | |
tree | f5b2f06eebc4e090060919202f111fc9d19cf9ac | |
parent | b47b7dd91676eb0869b6e9f61a6ff360b8e1f8e4 (diff) | |
download | tcl-2033b64487aee42c8bfeca4dcdc05443f424ab6c.zip tcl-2033b64487aee42c8bfeca4dcdc05443f424ab6c.tar.gz tcl-2033b64487aee42c8bfeca4dcdc05443f424ab6c.tar.bz2 |
* win/tclWinPipe.c (BuildCommandLine): Fixed bug #554068 ([exec]
on windows did not treat { in filenames well.). Bug reported by
Vince Darley <vincentdarley@users.sourceforge.net>, patch
provided by Vince too.
FossilOrigin-Name: 2c091448504829060f054ce6a932215b2aec04c4
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | tests/exec.test | 12 | ||||
-rw-r--r-- | win/tclWinPipe.c | 7 |
3 files changed, 24 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2002-06-17 Andreas Kupries <andreas_kupries@users.sourceforge.net> + + * win/tclWinPipe.c (BuildCommandLine): Fixed bug #554068 ([exec] + on windows did not treat { in filenames well.). Bug reported by + Vince Darley <vincentdarley@users.sourceforge.net>, patch + provided by Vince too. + 2002-06-17 Joe English <jenglish@users.sourceforge.net> * 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; } |