Artifacts Associated With Ticket 218702
Ticket change [10a4dd14b5] (rid 94998) by nobody on 2000-10-26 01:04:18:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1793 RFE Version: 8.1b3 SubmitDate: '1999-04-13' LastModified: '1999-05-03' Severity: LOW Status: Released Submitter: pat ChangedBy: stanton OS: Solaris OSVersion: 5.5.1 Machine: Other FixedDate: '1999-05-03' FixedInVersion: 8.1.1 ClosedDate: '2000-10-25' Name: Peter Weigand Comments: This patch may not work for all not writeable strings. DesiredBehavior: If you have a Tcl_Eval(interp, "do_my_command"); it does a segmentation error if you haven't compiled it with writeable strings. I have a small patch which will work for such one commands Tcl_Eval's and you do not need to make strings writeable. Patch: *** tclParse.cFri Apr 2 02:13:25 1999 --- tclParse.c.newTue Apr 13 14:01:01 1999 *************** *** 277,283 **** --- 277,285 ---- */ savedChar = string[numBytes]; + if (savedChar != 0) {/* not writeable? */ string[numBytes] = 0; + } /* * Parse any leading space and comments before the first word of the *************** *** 473,483 **** --- 475,489 ---- parsePtr->commandSize = src - parsePtr->commandStart; + if (savedChar != 0) {/* not writeable? */ string[numBytes] = (char) savedChar; + } return TCL_OK; error: + if (savedChar != 0) {/* not writeable? */ string[numBytes] = (char) savedChar; + } if (parsePtr->tokenPtr != parsePtr->staticTokens) { ckfree((char *) parsePtr->tokenPtr); parsePtr->tokenPtr = parsePtr->staticTokens; PatchFiles: tclParse.c This patch just avoids the problem in the case where you are passing exactly one word to eval. This is really a documentation bug. The Tcl_Eval manual entry needs to be clear that all strings passed to it must be writable. 04/15/1999 10:19 - stanton - The patch avoids modifying strings that are already null terminated. This should be safe since the action is a noop in any case. Applied the patch. 05/03/1999 16:47 - stanton - - foundin initialized to: "obsolete: 8.1b3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "46. Traces"
- title initialized to: "not always compile with writeable string"
- type initialized to: "Bug"
Ticket change [789ad63fbe] (rid 89988) by welch on 2000-10-26 08:27:12:
- closedate changed to: "2000-10-26T01:27:12"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [5fda033218] (rid 115890) by dgp on 2001-04-04 14:02:51:
- closedate changed to: "2001-04-04T07:02:51"
- closer changed to: "dgp"
- subsystem changed to: "45. Parsing and Eval"