diff options
author | andreas_kupries <akupries@shaw.ca> | 2002-06-17 20:05:49 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2002-06-17 20:05:49 (GMT) |
commit | d791a1f9dbfd5b4dd46a45187426558573eec9ce (patch) | |
tree | f5b2f06eebc4e090060919202f111fc9d19cf9ac | |
parent | 9153e89fb7f07be33d811904b905fd07fe8af916 (diff) | |
download | tcl-d791a1f9dbfd5b4dd46a45187426558573eec9ce.zip tcl-d791a1f9dbfd5b4dd46a45187426558573eec9ce.tar.gz tcl-d791a1f9dbfd5b4dd46a45187426558573eec9ce.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.
-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; } |