unable to append to a value of env
Closed / Fixed218020ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:52:15
OriginalBugID: 1135 Bug
Version: 8.0.3
SubmitDate: '1999-02-02'
LastModified: '1999-04-16'
Severity: MED
Status: Closed
Submitter: welch
ChangedBy: rjohnson
OS: Windows NT
OSVersion: 4.0
Machine: X86
FixedDate: '2000-10-25'
ClosedDate: '1999-04-16'
Name:
Kirk Augustin
Extensions:
Aim
CustomShell:
lots
ReproducibleScript:
append env(TMP) "xxx"
# where TMP is any valid env entry, and "xxx" is any string.
ObservedBehavior:
# You get a Purify error, and
puts $env(TMP)
# is garbage
DesiredBehavior:
obvious
Patch:
# in file generic\tclEnv.c, function TclSetEnv, move
/*
* Update all of the interpreters.
*/
for (eiPtr= firstInterpPtr; eiPtr != NULL; eiPtr = eiPtr->nextPtr) {
(void) Tcl_SetVar2(eiPtr->interp, "env", (char *) name,
(char *) value, TCL_GLOBAL_ONLY);
}
# To the end of the function, AFTER the env entry for the local interpreter is
# appended. This prevents the env trace in other interpeters from going cyclic.
PatchFiles:
# file: generic\tclEnv.c
# function: TclSetEnv()
The old code tried to update the other interpreters before updating its own interpreter env, but each interpreter fired traces and caused an endless cycle, until memory was corrupted.
This works in 8.1. Closing this bug. 04/16/1999 18:31 - rjohnson -
welch Closed ticket [218020ffff].
[History diff]2000-10-26 08:12:12
dgp Ticket [218020ffff]: 3 changes
[History diff]2001-04-16 23:00:11
Log in (anonymous is fine) to add a comment.