From ae07e289b2b5cd44065d2a1d64003a56c3071977 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Tue, 11 Feb 2003 18:03:22 +0000 Subject: * generic/tclParse.c * tests/parse.test: fix for [Bug 684744], by Don Porter. --- ChangeLog | 5 +++++ generic/tclParse.c | 4 ++-- tests/parse.test | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1f87d8..1d7c1e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-02-11 Miguel Sofer + + * generic/tclParse.c + * tests/parse.test: fix for [Bug 684744], by Don Porter. + 2003-02-11 Jeff Hobbs * generic/tclIOUtil.c (Tcl_FSJoinPath, Tcl_FSGetNormalizedPath): diff --git a/generic/tclParse.c b/generic/tclParse.c index 230edee..f1ffec7 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclParse.c,v 1.22 2002/08/05 03:24:41 dgp Exp $ + * RCS: @(#) $Id: tclParse.c,v 1.23 2003/02/11 18:03:27 msofer Exp $ */ #include "tclInt.h" @@ -1646,7 +1646,7 @@ CommandComplete(script, numBytes) while (Tcl_ParseCommand((Tcl_Interp *) NULL, p, end - p, 0, &parse) == TCL_OK) { p = parse.commandStart + parse.commandSize; - if (*p == 0) { + if (p == end) { break; } Tcl_FreeParse(&parse); diff --git a/tests/parse.test b/tests/parse.test index 472e5d4..5f1ee4a 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: parse.test,v 1.8 2001/09/13 11:56:20 msofer Exp $ +# RCS: @(#) $Id: parse.test,v 1.9 2003/02/11 18:03:28 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -727,6 +727,10 @@ test parse-15.57 {CommandComplete procedure} { test parse-15.58 {CommandComplete procedure, memory leaks} { info complete "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22" } 1 +test parse-15.58 {CommandComplete procedure} { + # Test for Tcl Bug 684744 + info complete [encoding convertfrom identity "\x00;if 1 \{"] +} 0 test parse-16.1 {Tcl_EvalEx, check termOffset is set correctly for non TCL_OK cases, bug 2535} { subst {[eval {return foo}]bar} -- cgit v0.12