summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEncoding.c13
-rw-r--r--generic/tclVar.c10
2 files changed, 17 insertions, 6 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 619c2b4..5fd3f20 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEncoding.c,v 1.55.2.2 2007/11/12 19:18:16 dgp Exp $
+ * RCS: @(#) $Id: tclEncoding.c,v 1.55.2.3 2008/03/13 14:47:29 dgp Exp $
*/
#include "tclInt.h"
@@ -1972,6 +1972,7 @@ LoadEscapeEncoding(
final[sizeof(final) - 1] = '\0';
} else {
EscapeSubTable est;
+ Encoding *e;
strncpy(est.sequence, argv[1], sizeof(est.sequence));
est.sequence[sizeof(est.sequence) - 1] = '\0';
@@ -1984,9 +1985,13 @@ LoadEscapeEncoding(
* To avoid infinite recursion in [encoding system iso2022-*]
*/
- Tcl_GetEncoding(NULL, est.name);
-
- est.encodingPtr = NULL;
+ e = (Encoding *) Tcl_GetEncoding(NULL, est.name);
+ if (e && e->toUtfProc != TableToUtfProc &&
+ e->toUtfProc != Iso88591ToUtfProc) {
+ Tcl_FreeEncoding((Tcl_Encoding) e);
+ e = NULL;
+ }
+ est.encodingPtr = e;
Tcl_DStringAppend(&escapeData, (char *) &est, sizeof(est));
}
}
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 14b37a6..1244053 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -16,7 +16,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclVar.c,v 1.135.2.13 2007/11/25 06:45:44 dgp Exp $
+ * RCS: @(#) $Id: tclVar.c,v 1.135.2.14 2008/03/13 14:47:29 dgp Exp $
*/
#include "tclInt.h"
@@ -4360,10 +4360,16 @@ TclDeleteNamespaceVars(
for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL;
varPtr = VarHashFirstVar(tablePtr, &search)) {
+ Tcl_Obj *objPtr = Tcl_NewObj();
+ Tcl_IncrRefCount(objPtr);
+
VarHashRefCount(varPtr)++; /* Make sure we get to remove from
* hash. */
- UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ VarHashGetKey(varPtr),
+ Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, objPtr);
+ UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ objPtr,
NULL, flags);
+ Tcl_DecrRefCount(objPtr); /* free no longer needed obj */
+
/*
* Remove the variable from the table and force it undefined in case