Artifacts Associated With Ticket 217886
Ticket change [1f0f181ff8] (rid 91080) by nobody on 2000-10-26 00:45:23:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2382 Bug Version: 8.2b1 SubmitDate: '1999-07-16' LastModified: '1999-07-29' Severity: LOW Status: Closed Submitter: techsupp ChangedBy: redman RelatedBugIDs: 2466 OS: Other Machine: NA FixedDate: '1999-07-21' ClosedDate: '1999-07-29' Name: Peter Spjuth ObservedBehavior: info complete returns 1 for a string missing a close bracket, if the last char is a close bracket: % info complete {[a [b]} 1 By adding a space: % info complete {[a [b] } 0 They are also treated slightly differently by eval, the difference is that the error is caught later in the buggy case: % eval {[a [b]} missing close-bracket % set errorInfo missing close-bracket while compiling "a" while compiling "[a [b]" ("eval" body line 1) invoked from within "eval {[a [b]}" % eval {[a [b] } missing close-bracket % set errorInfo missing close-bracket while compiling "[a [b] " ("eval" body line 1) invoked from within "eval {[a [b] }" The bug is in ParseTokens() in tclParse.c When encountering an open bracket, the rest is parsed until a matching close bracket is found, or the string is ended. After that, the only check is whether the last parsed char was a close bracket. No check is made if it was that close bracket, or an end of string that terminated the parse. Patch: *** tclParse.orig Fri Jul 16 22:02:32 1999 --- tclParse.c Fri Jul 16 22:23:54 1999 *************** *** 607,613 **** if (nested.tokenPtr != nested.staticTokens) { ckfree((char *) nested.tokenPtr); } ! if ((src[-1] == ']') && !nested.incomplete) { break; } if (src == parsePtr->end) { --- 607,614 ---- if (nested.tokenPtr != nested.staticTokens) { ckfree((char *) nested.tokenPtr); } ! if ((*nested.term != 0) && (src[-1] == ']') ! && !nested.incomplete) { break; } if (src == parsePtr->end) { PatchFiles: tclParse.c (CVS 1.8) Applied patch, added test case. Fixed in 8.2b2. -- 07/21/1999 redman Bad patch, removed changes. The patch breaks other test cases on Unix but not Windows. Needs more investigation. -- 07/23/1999 redman See 2466, new patch. -- 07/29/1999 redman - foundin initialized to: "obsolete: 8.2b1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "info complete gives wrong answer"
- type initialized to: "Bug"
Ticket change [e75f4c79ae] (rid 104447) by welch on 2000-10-26 08:09:11:
- closedate changed to: "2000-10-26T01:09:11"
- closer changed to: "welch"
- priority changed to: "3 Low"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [6836873aba] (rid 103021) by dgp on 2001-04-14 01:41:53:
- subsystem changed to: "45. Parsing and Eval"
Ticket change [af618ca7f8] (rid 97802) by dgp on 2001-04-14 01:41:54:
- closedate changed to: "2001-04-13T18:41:54"
- closer changed to: "dgp"