summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-06-20 11:59:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-06-20 11:59:53 (GMT)
commit8d491be45a9f0228131d2270f9df11a5de49c796 (patch)
treed4378dc4a193c780203ebbe55a1a398382f9443a /generic
parenta1e02fc1aef789c4ae0fb361985350eff6038f54 (diff)
parent70a602230d375d8be7a9e4a1c81e74b05fc2659b (diff)
downloadtcl-8d491be45a9f0228131d2270f9df11a5de49c796.zip
tcl-8d491be45a9f0228131d2270f9df11a5de49c796.tar.gz
tcl-8d491be45a9f0228131d2270f9df11a5de49c796.tar.bz2
Merg [3148192] implementation fix, and caveat comment
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIOCmd.c2
-rw-r--r--generic/tclTrace.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 9294dd6..349814a 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -140,7 +140,7 @@ Tcl_PutsObjCmd(
string = objv[3];
break;
#if TCL_MAJOR_VERSION < 9
- } else if (strcmp(TclGetString(objv[2]), "nonewline") == 0) {
+ } else if (strcmp(TclGetString(objv[3]), "nonewline") == 0) {
/*
* The code below provides backwards compatibility with an old
* form of the command that is no longer recommended or
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index a60a80b..13359ee 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -2883,6 +2883,16 @@ Tcl_UntraceVar2(
* The code below makes it possible to delete traces while traces are
* active: it makes sure that the deleted trace won't be processed by
* TclCallVarTraces.
+ *
+ * Caveat (Bug 3062331): When an unset trace handler on a variable
+ * tries to delete a different unset trace handler on the same variable,
+ * the results may be surprising. When variable unset traces fire, the
+ * traced variable is already gone. So the TclLookupVar() call above
+ * will not find that variable, and not finding it will never reach here
+ * to perform the deletion. This means callers of Tcl_UntraceVar*()
+ * attempting to delete unset traces from within the handler of another
+ * unset trace have to account for the possibility that their call to
+ * Tcl_UntraceVar*() is a no-op.
*/
for (activePtr = iPtr->activeVarTracePtr; activePtr != NULL;