diff options
author | dgp <dgp@users.sourceforge.net> | 2004-03-08 16:34:22 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-03-08 16:34:22 (GMT) |
commit | 9c04301ef6c66c0166de0a8d94972ac3deacded6 (patch) | |
tree | 8d273db47836b31f4418cc8bc53fe7e49cb9ce99 /generic | |
parent | b82333ed5bcaa724c7eb81ff20f6d96b1f5cc59f (diff) | |
download | tcl-9c04301ef6c66c0166de0a8d94972ac3deacded6.zip tcl-9c04301ef6c66c0166de0a8d94972ac3deacded6.tar.gz tcl-9c04301ef6c66c0166de0a8d94972ac3deacded6.tar.bz2 |
* generic/tclParse.c (TclParseInit): Modified TclParseInit so
* generic/tclTest.c ([testexprparser]): that Tcl_Parse initialization
conforms to documented promised about what fields will not be
modified by what Tcl_Parse* routines. [Bug 910595]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclParse.c | 13 | ||||
-rw-r--r-- | generic/tclTest.c | 6 |
2 files changed, 10 insertions, 9 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index de95afe..ca6c5a8 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.34 2004/03/04 23:25:14 dgp Exp $ + * RCS: @(#) $Id: tclParse.c,v 1.35 2004/03/08 16:34:22 dgp Exp $ */ #include "tclInt.h" @@ -206,10 +206,6 @@ TclParseInit(interp, string, numBytes, parsePtr) * the first null character. */ Tcl_Parse *parsePtr; /* Points to struct to initialize */ { - parsePtr->commentStart = NULL; - parsePtr->commentSize = 0; - parsePtr->commandStart = NULL; - parsePtr->commandSize = 0; parsePtr->numWords = 0; parsePtr->tokenPtr = parsePtr->staticTokens; parsePtr->numTokens = 0; @@ -288,6 +284,10 @@ Tcl_ParseCommand(interp, string, numBytes, nested, parsePtr) numBytes = strlen(string); } TclParseInit(interp, string, numBytes, parsePtr); + parsePtr->commentStart = NULL; + parsePtr->commentSize = 0; + parsePtr->commandStart = NULL; + parsePtr->commandSize = 0; if (nested != 0) { terminators = TYPE_COMMAND_END | TYPE_CLOSE_BRACK; } else { @@ -470,9 +470,6 @@ parseWord: error: Tcl_FreeParse(parsePtr); - if (parsePtr->commandStart == NULL) { - parsePtr->commandStart = string; - } parsePtr->commandSize = parsePtr->end - parsePtr->commandStart; return TCL_ERROR; } diff --git a/generic/tclTest.c b/generic/tclTest.c index d29c132..b0380f6 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.78 2004/03/05 16:36:56 kennykb Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.79 2004/03/08 16:34:23 dgp Exp $ */ #define TCL_TEST @@ -3067,6 +3067,10 @@ TestexprparserObjCmd(clientData, interp, objc, objv) if (length == 0) { length = dummy; } + parse.commentStart = NULL; + parse.commentSize = 0; + parse.commandStart = NULL; + parse.commandSize = 0; if (Tcl_ParseExpr(interp, script, length, &parse) != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (remainder of expr: \""); Tcl_AddErrorInfo(interp, parse.term); |