Index: generic/tcl.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.decls,v
retrieving revision 1.90
diff -u -r1.90 tcl.decls
--- generic/tcl.decls	21 Jun 2002 14:22:28 -0000	1.90
+++ generic/tcl.decls	16 Jul 2002 19:24:10 -0000
@@ -625,10 +625,10 @@
     CONST char * Tcl_GetStringResult(Tcl_Interp *interp)
 }
 declare 175 generic {
-    CONST char * Tcl_GetVar(Tcl_Interp *interp, char *varName, int flags)
+    CONST char * Tcl_GetVar(Tcl_Interp *interp, CONST char *varName, int flags)
 }
 declare 176 generic {
-    CONST char * Tcl_GetVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
+    CONST char * Tcl_GetVar2(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
 	    int flags)
 }
 declare 177 generic {
@@ -834,12 +834,12 @@
     void Tcl_SetStdChannel(Tcl_Channel channel, int type)
 }
 declare 237 generic {
-    CONST char * Tcl_SetVar(Tcl_Interp *interp, char *varName,
+    CONST char * Tcl_SetVar(Tcl_Interp *interp, CONST char *varName,
 	    CONST char *newValue, int flags)
 }
 declare 238 generic {
-    CONST char * Tcl_SetVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
-	    CONST char *newValue, int flags)
+    CONST char * Tcl_SetVar2(Tcl_Interp *interp, CONST char *part1, 
+            CONST char *part2, CONST char *newValue, int flags)
 }
 declare 239 generic {
     CONST char * Tcl_SignalId(int sig)
@@ -870,11 +870,11 @@
     int Tcl_TellOld(Tcl_Channel chan)
 }
 declare 247 generic {
-    int Tcl_TraceVar(Tcl_Interp *interp, char *varName, int flags,
+    int Tcl_TraceVar(Tcl_Interp *interp, CONST char *varName, int flags,
 	    Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 248 generic {
-    int Tcl_TraceVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
+    int Tcl_TraceVar2(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
 	    int flags, Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 249 generic {
@@ -891,40 +891,40 @@
     int Tcl_UnregisterChannel(Tcl_Interp *interp, Tcl_Channel chan)
 }
 declare 253 generic {
-    int Tcl_UnsetVar(Tcl_Interp *interp, char *varName, int flags)
+    int Tcl_UnsetVar(Tcl_Interp *interp, CONST char *varName, int flags)
 }
 declare 254 generic {
-    int Tcl_UnsetVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
+    int Tcl_UnsetVar2(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
 	    int flags)
 }
 declare 255 generic {
-    void Tcl_UntraceVar(Tcl_Interp *interp, char *varName, int flags,
+    void Tcl_UntraceVar(Tcl_Interp *interp, CONST char *varName, int flags,
 	    Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 256 generic {
-    void Tcl_UntraceVar2(Tcl_Interp *interp, char *part1, CONST char *part2,
+    void Tcl_UntraceVar2(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
 	    int flags, Tcl_VarTraceProc *proc, ClientData clientData)
 }
 declare 257 generic {
     void Tcl_UpdateLinkedVar(Tcl_Interp *interp, char *varName)
 }
 declare 258 generic {
-    int Tcl_UpVar(Tcl_Interp *interp, CONST char *frameName, char *varName,
+    int Tcl_UpVar(Tcl_Interp *interp, CONST char *frameName, CONST char *varName,
 	    CONST char *localName, int flags)
 }
 declare 259 generic {
-    int Tcl_UpVar2(Tcl_Interp *interp, CONST char *frameName, char *part1,
+    int Tcl_UpVar2(Tcl_Interp *interp, CONST char *frameName, CONST char *part1,
 	    CONST char *part2, CONST char *localName, int flags)
 }
 declare 260 generic {
     int Tcl_VarEval(Tcl_Interp *interp, ...)
 }
 declare 261 generic {
-    ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, char *varName,
+    ClientData Tcl_VarTraceInfo(Tcl_Interp *interp, CONST char *varName,
 	    int flags, Tcl_VarTraceProc *procPtr, ClientData prevClientData)
 }
 declare 262 generic {
-    ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, char *part1,
+    ClientData Tcl_VarTraceInfo2(Tcl_Interp *interp, CONST char *part1,
 	    CONST char *part2, int flags, Tcl_VarTraceProc *procPtr,
 	    ClientData prevClientData)
 }
@@ -1094,7 +1094,7 @@
     VOID * Tcl_GetThreadData(Tcl_ThreadDataKey *keyPtr, int size)
 }
 declare 306 generic {
-    Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, char *part1, CONST char *part2,
+    Tcl_Obj * Tcl_GetVar2Ex(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
 	    int flags)
 }
 declare 307 generic {
@@ -1130,8 +1130,8 @@
     int Tcl_SetSystemEncoding(Tcl_Interp *interp, CONST char *name)
 }
 declare 317 generic {
-    Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, char *part1, CONST char *part2,
-	    Tcl_Obj *newValuePtr, int flags)
+    Tcl_Obj * Tcl_SetVar2Ex(Tcl_Interp *interp, CONST char *part1, 
+            CONST char *part2, Tcl_Obj *newValuePtr, int flags)
 }
 declare 318 generic {
     void Tcl_ThreadAlert(Tcl_ThreadId threadId)
Index: generic/tcl.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.h,v
retrieving revision 1.132
diff -u -r1.132 tcl.h
--- generic/tcl.h	14 Jul 2002 17:29:01 -0000	1.132
+++ generic/tcl.h	16 Jul 2002 19:24:12 -0000
@@ -680,7 +680,7 @@
 	struct Tcl_Obj *objPtr));
 typedef void (Tcl_UpdateStringProc) _ANSI_ARGS_((struct Tcl_Obj *objPtr));
 typedef char *(Tcl_VarTraceProc) _ANSI_ARGS_((ClientData clientData,
-	Tcl_Interp *interp, char *part1, CONST84 char *part2, int flags));
+	Tcl_Interp *interp, CONST84 char *part1, CONST84 char *part2, int flags));
 typedef void (Tcl_CommandTraceProc) _ANSI_ARGS_((ClientData clientData,
 	Tcl_Interp *interp, CONST char *oldName, CONST char *newName,
 	int flags));
Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.73
diff -u -r1.73 tclCmdMZ.c
--- generic/tclCmdMZ.c	19 Jun 2002 22:38:39 -0000	1.73
+++ generic/tclCmdMZ.c	16 Jul 2002 19:24:14 -0000
@@ -116,8 +116,8 @@
                             char *command, int numChars,
                             int objc, Tcl_Obj *CONST objv[]));
 static char *		TraceVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1, 
+                            CONST char *name2, int flags));
 static void		TraceCommandProc _ANSI_ARGS_((ClientData clientData,
 			    Tcl_Interp *interp, CONST char *oldName,
                             CONST char *newName, int flags));
@@ -4417,7 +4417,7 @@
 TraceVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Information about the variable trace. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable or array. */
+    CONST char *name1;		/* Name of variable or array. */
     CONST char *name2;		/* Name of element within array;  NULL means
 				 * scalar variable is being referenced. */
     int flags;			/* OR-ed bits giving operation and other
Index: generic/tclDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDecls.h,v
retrieving revision 1.90
diff -u -r1.90 tclDecls.h
--- generic/tclDecls.h	22 Jun 2002 00:06:23 -0000	1.90
+++ generic/tclDecls.h	16 Jul 2002 19:24:16 -0000
@@ -571,10 +571,11 @@
 EXTERN CONST char *	Tcl_GetStringResult _ANSI_ARGS_((Tcl_Interp * interp));
 /* 175 */
 EXTERN CONST char *	Tcl_GetVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName, int flags));
+				CONST char * varName, int flags));
 /* 176 */
 EXTERN CONST char *	Tcl_GetVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags));
+				CONST char * part1, CONST char * part2, 
+				int flags));
 /* 177 */
 EXTERN int		Tcl_GlobalEval _ANSI_ARGS_((Tcl_Interp * interp, 
 				char * command));
@@ -768,11 +769,11 @@
 				int type));
 /* 237 */
 EXTERN CONST char *	Tcl_SetVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName, CONST char * newValue, 
+				CONST char * varName, CONST char * newValue, 
 				int flags));
 /* 238 */
 EXTERN CONST char *	Tcl_SetVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, 
+				CONST char * part1, CONST char * part2, 
 				CONST char * newValue, int flags));
 /* 239 */
 EXTERN CONST char *	Tcl_SignalId _ANSI_ARGS_((int sig));
@@ -799,13 +800,13 @@
 EXTERN int		Tcl_TellOld _ANSI_ARGS_((Tcl_Channel chan));
 /* 247 */
 EXTERN int		Tcl_TraceVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName, int flags, 
+				CONST char * varName, int flags, 
 				Tcl_VarTraceProc * proc, 
 				ClientData clientData));
 /* 248 */
 EXTERN int		Tcl_TraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags, 
-				Tcl_VarTraceProc * proc, 
+				CONST char * part1, CONST char * part2, 
+				int flags, Tcl_VarTraceProc * proc, 
 				ClientData clientData));
 /* 249 */
 EXTERN char *		Tcl_TranslateFileName _ANSI_ARGS_((
@@ -822,43 +823,44 @@
 				Tcl_Interp * interp, Tcl_Channel chan));
 /* 253 */
 EXTERN int		Tcl_UnsetVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName, int flags));
+				CONST char * varName, int flags));
 /* 254 */
 EXTERN int		Tcl_UnsetVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags));
+				CONST char * part1, CONST char * part2, 
+				int flags));
 /* 255 */
 EXTERN void		Tcl_UntraceVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName, int flags, 
+				CONST char * varName, int flags, 
 				Tcl_VarTraceProc * proc, 
 				ClientData clientData));
 /* 256 */
 EXTERN void		Tcl_UntraceVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags, 
-				Tcl_VarTraceProc * proc, 
+				CONST char * part1, CONST char * part2, 
+				int flags, Tcl_VarTraceProc * proc, 
 				ClientData clientData));
 /* 257 */
 EXTERN void		Tcl_UpdateLinkedVar _ANSI_ARGS_((Tcl_Interp * interp, 
 				char * varName));
 /* 258 */
 EXTERN int		Tcl_UpVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				CONST char * frameName, char * varName, 
+				CONST char * frameName, CONST char * varName, 
 				CONST char * localName, int flags));
 /* 259 */
 EXTERN int		Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				CONST char * frameName, char * part1, 
+				CONST char * frameName, CONST char * part1, 
 				CONST char * part2, CONST char * localName, 
 				int flags));
 /* 260 */
 EXTERN int		Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
 /* 261 */
 EXTERN ClientData	Tcl_VarTraceInfo _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName, int flags, 
+				CONST char * varName, int flags, 
 				Tcl_VarTraceProc * procPtr, 
 				ClientData prevClientData));
 /* 262 */
 EXTERN ClientData	Tcl_VarTraceInfo2 _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags, 
-				Tcl_VarTraceProc * procPtr, 
+				CONST char * part1, CONST char * part2, 
+				int flags, Tcl_VarTraceProc * procPtr, 
 				ClientData prevClientData));
 /* 263 */
 EXTERN int		Tcl_Write _ANSI_ARGS_((Tcl_Channel chan, 
@@ -994,7 +996,8 @@
 				Tcl_ThreadDataKey * keyPtr, int size));
 /* 306 */
 EXTERN Tcl_Obj *	Tcl_GetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags));
+				CONST char * part1, CONST char * part2, 
+				int flags));
 /* 307 */
 EXTERN ClientData	Tcl_InitNotifier _ANSI_ARGS_((void));
 /* 308 */
@@ -1026,7 +1029,7 @@
 				Tcl_Interp * interp, CONST char * name));
 /* 317 */
 EXTERN Tcl_Obj *	Tcl_SetVar2Ex _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, 
+				CONST char * part1, CONST char * part2, 
 				Tcl_Obj * newValuePtr, int flags));
 /* 318 */
 EXTERN void		Tcl_ThreadAlert _ANSI_ARGS_((Tcl_ThreadId threadId));
@@ -1774,8 +1777,8 @@
     Tcl_Interp * (*tcl_GetSlave) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * slaveName)); /* 172 */
     Tcl_Channel (*tcl_GetStdChannel) _ANSI_ARGS_((int type)); /* 173 */
     CONST char * (*tcl_GetStringResult) _ANSI_ARGS_((Tcl_Interp * interp)); /* 174 */
-    CONST char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 175 */
-    CONST char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 176 */
+    CONST char * (*tcl_GetVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags)); /* 175 */
+    CONST char * (*tcl_GetVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags)); /* 176 */
     int (*tcl_GlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, char * command)); /* 177 */
     int (*tcl_GlobalEvalObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 178 */
     int (*tcl_HideCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, CONST char * hiddenCmdToken)); /* 179 */
@@ -1852,8 +1855,8 @@
     void (*tcl_SetObjErrorCode) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * errorObjPtr)); /* 234 */
     void (*tcl_SetObjResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * resultObjPtr)); /* 235 */
     void (*tcl_SetStdChannel) _ANSI_ARGS_((Tcl_Channel channel, int type)); /* 236 */
-    CONST char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, CONST char * newValue, int flags)); /* 237 */
-    CONST char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, CONST char * newValue, int flags)); /* 238 */
+    CONST char * (*tcl_SetVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, CONST char * newValue, int flags)); /* 237 */
+    CONST char * (*tcl_SetVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, CONST char * newValue, int flags)); /* 238 */
     CONST char * (*tcl_SignalId) _ANSI_ARGS_((int sig)); /* 239 */
     CONST char * (*tcl_SignalMsg) _ANSI_ARGS_((int sig)); /* 240 */
     void (*tcl_SourceRCFile) _ANSI_ARGS_((Tcl_Interp * interp)); /* 241 */
@@ -1862,22 +1865,22 @@
     void (*tcl_StaticPackage) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pkgName, Tcl_PackageInitProc * initProc, Tcl_PackageInitProc * safeInitProc)); /* 244 */
     int (*tcl_StringMatch) _ANSI_ARGS_((CONST char * str, CONST char * pattern)); /* 245 */
     int (*tcl_TellOld) _ANSI_ARGS_((Tcl_Channel chan)); /* 246 */
-    int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */
-    int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */
+    int (*tcl_TraceVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 247 */
+    int (*tcl_TraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 248 */
     char * (*tcl_TranslateFileName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tcl_DString * bufferPtr)); /* 249 */
     int (*tcl_Ungets) _ANSI_ARGS_((Tcl_Channel chan, CONST char * str, int len, int atHead)); /* 250 */
     void (*tcl_UnlinkVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 251 */
     int (*tcl_UnregisterChannel) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan)); /* 252 */
-    int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags)); /* 253 */
-    int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 254 */
-    void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 255 */
-    void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */
+    int (*tcl_UnsetVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags)); /* 253 */
+    int (*tcl_UnsetVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags)); /* 254 */
+    void (*tcl_UntraceVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 255 */
+    void (*tcl_UntraceVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * proc, ClientData clientData)); /* 256 */
     void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 257 */
-    int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * varName, CONST char * localName, int flags)); /* 258 */
-    int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, char * part1, CONST char * part2, CONST char * localName, int flags)); /* 259 */
+    int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, CONST char * varName, CONST char * localName, int flags)); /* 258 */
+    int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, CONST char * part1, CONST char * part2, CONST char * localName, int flags)); /* 259 */
     int (*tcl_VarEval) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 260 */
-    ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */
-    ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */
+    ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */
+    ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */
     int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, CONST char * s, int slen)); /* 263 */
     void (*tcl_WrongNumArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], CONST char * message)); /* 264 */
     int (*tcl_DumpActiveMemory) _ANSI_ARGS_((CONST char * fileName)); /* 265 */
@@ -1921,7 +1924,7 @@
     void (*tcl_GetEncodingNames) _ANSI_ARGS_((Tcl_Interp * interp)); /* 303 */
     int (*tcl_GetIndexFromObjStruct) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, CONST VOID * tablePtr, int offset, CONST char * msg, int flags, int * indexPtr)); /* 304 */
     VOID * (*tcl_GetThreadData) _ANSI_ARGS_((Tcl_ThreadDataKey * keyPtr, int size)); /* 305 */
-    Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags)); /* 306 */
+    Tcl_Obj * (*tcl_GetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags)); /* 306 */
     ClientData (*tcl_InitNotifier) _ANSI_ARGS_((void)); /* 307 */
     void (*tcl_MutexLock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 308 */
     void (*tcl_MutexUnlock) _ANSI_ARGS_((Tcl_Mutex * mutexPtr)); /* 309 */
@@ -1932,7 +1935,7 @@
     void (*tcl_RestoreResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 314 */
     void (*tcl_SaveResult) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_SavedResult * statePtr)); /* 315 */
     int (*tcl_SetSystemEncoding) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 316 */
-    Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */
+    Tcl_Obj * (*tcl_SetVar2Ex) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, Tcl_Obj * newValuePtr, int flags)); /* 317 */
     void (*tcl_ThreadAlert) _ANSI_ARGS_((Tcl_ThreadId threadId)); /* 318 */
     void (*tcl_ThreadQueueEvent) _ANSI_ARGS_((Tcl_ThreadId threadId, Tcl_Event* evPtr, Tcl_QueuePosition position)); /* 319 */
     Tcl_UniChar (*tcl_UniCharAtIndex) _ANSI_ARGS_((CONST char * src, int index)); /* 320 */
Index: generic/tclEnv.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclEnv.c,v
retrieving revision 1.15
diff -u -r1.15 tclEnv.c
--- generic/tclEnv.c	6 Jun 2002 17:37:55 -0000	1.15
+++ generic/tclEnv.c	16 Jul 2002 19:24:17 -0000
@@ -46,8 +46,8 @@
  */
 
 static char *		EnvTraceProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1, 
+			    CONST char *name2, int flags));
 static void		ReplaceString _ANSI_ARGS_((CONST char *oldStr,
 			    char *newStr));
 void			TclSetEnv _ANSI_ARGS_((CONST char *name,
@@ -520,7 +520,7 @@
     ClientData clientData;	/* Not used. */
     Tcl_Interp *interp;		/* Interpreter whose "env" variable is
 				 * being modified. */
-    char *name1;		/* Better be "env". */
+    CONST char *name1;		/* Better be "env". */
     CONST char *name2;		/* Name of variable being modified, or NULL
 				 * if whole array is being deleted (UTF-8). */
     int flags;			/* Indicates what's happening. */
Index: generic/tclEvent.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclEvent.c,v
retrieving revision 1.22
diff -u -r1.22 tclEvent.c
--- generic/tclEvent.c	14 May 2002 09:44:43 -0000	1.22
+++ generic/tclEvent.c	16 Jul 2002 19:24:17 -0000
@@ -111,8 +111,8 @@
 			    Tcl_Interp *interp));
 static void		HandleBgErrors _ANSI_ARGS_((ClientData clientData));
 static char *		VwaitVarProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1, 
+			    CONST char *name2, int flags));
 
 /*
  *----------------------------------------------------------------------
@@ -1012,7 +1012,7 @@
 VwaitVarProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Pointer to integer to set to 1. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tclInt.decls
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInt.decls,v
retrieving revision 1.52
diff -u -r1.52 tclInt.decls
--- generic/tclInt.decls	15 Jul 2002 22:18:04 -0000	1.52
+++ generic/tclInt.decls	16 Jul 2002 19:24:19 -0000
@@ -236,7 +236,7 @@
 #      int TclLooksLikeInt(char *p)
 #  }
 declare 58 generic {
-    Var * TclLookupVar(Tcl_Interp *interp, char *part1, CONST char *part2,
+    Var * TclLookupVar(Tcl_Interp *interp, CONST char *part1, CONST char *part2,
 	    int flags, CONST char *msg, int createPart1, int createPart2,
 	    Var **arrayPtrPtr)
 }
@@ -347,7 +347,7 @@
 #  }
 declare 88 generic {
     char * TclPrecTraceProc(ClientData clientData, Tcl_Interp *interp,
-	    char *name1, CONST char *name2, int flags)
+	    CONST char *name1, CONST char *name2, int flags)
 }
 declare 89 generic {
     int TclPreventAliasLoop(Tcl_Interp *interp, Tcl_Interp *cmdInterp,
@@ -608,7 +608,7 @@
 	    int status)
 }
 declare 157 generic {
-    Var * TclVarTraceExists (Tcl_Interp *interp, char *varName)
+    Var * TclVarTraceExists (Tcl_Interp *interp, CONST char *varName)
 }
 declare 158 generic {
     void TclSetStartupScriptFileName(CONST char *filename)
Index: generic/tclIntDecls.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIntDecls.h,v
retrieving revision 1.43
diff -u -r1.43 tclIntDecls.h
--- generic/tclIntDecls.h	15 Jul 2002 22:18:06 -0000	1.43
+++ generic/tclIntDecls.h	16 Jul 2002 19:24:19 -0000
@@ -209,8 +209,8 @@
 /* Slot 57 is reserved */
 /* 58 */
 EXTERN Var *		TclLookupVar _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * part1, CONST char * part2, int flags, 
-				CONST char * msg, int createPart1, 
+				CONST char * part1, CONST char * part2, 
+				int flags, CONST char * msg, int createPart1, 
 				int createPart2, Var ** arrayPtrPtr));
 /* Slot 59 is reserved */
 /* 60 */
@@ -266,7 +266,7 @@
 /* Slot 87 is reserved */
 /* 88 */
 EXTERN char *		TclPrecTraceProc _ANSI_ARGS_((ClientData clientData, 
-				Tcl_Interp * interp, char * name1, 
+				Tcl_Interp * interp, CONST char * name1, 
 				CONST char * name2, int flags));
 /* 89 */
 EXTERN int		TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp * interp, 
@@ -475,7 +475,7 @@
 				CONST char * msg, int status));
 /* 157 */
 EXTERN Var *		TclVarTraceExists _ANSI_ARGS_((Tcl_Interp * interp, 
-				char * varName));
+				CONST char * varName));
 /* 158 */
 EXTERN void		TclSetStartupScriptFileName _ANSI_ARGS_((
 				CONST char * filename));
@@ -597,7 +597,7 @@
     Proc * (*tclIsProc) _ANSI_ARGS_((Command * cmdPtr)); /* 55 */
     void *reserved56;
     void *reserved57;
-    Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, char * part1, CONST char * part2, int flags, CONST char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */
+    Var * (*tclLookupVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, CONST char * msg, int createPart1, int createPart2, Var ** arrayPtrPtr)); /* 58 */
     void *reserved59;
     int (*tclNeedSpace) _ANSI_ARGS_((CONST char * start, CONST char * end)); /* 60 */
     Tcl_Obj * (*tclNewProcBodyObj) _ANSI_ARGS_((Proc * procPtr)); /* 61 */
@@ -627,7 +627,7 @@
     void *reserved85;
     void *reserved86;
     void *reserved87;
-    char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, char * name1, CONST char * name2, int flags)); /* 88 */
+    char * (*tclPrecTraceProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, CONST char * name1, CONST char * name2, int flags)); /* 88 */
     int (*tclPreventAliasLoop) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Interp * cmdInterp, Tcl_Command cmd)); /* 89 */
     void *reserved90;
     void (*tclProcCleanupProc) _ANSI_ARGS_((Proc * procPtr)); /* 91 */
@@ -712,7 +712,7 @@
     void *reserved154;
     void *reserved155;
     void (*tclRegError) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * msg, int status)); /* 156 */
-    Var * (*tclVarTraceExists) _ANSI_ARGS_((Tcl_Interp * interp, char * varName)); /* 157 */
+    Var * (*tclVarTraceExists) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName)); /* 157 */
     void (*tclSetStartupScriptFileName) _ANSI_ARGS_((CONST char * filename)); /* 158 */
     CONST char * (*tclGetStartupScriptFileName) _ANSI_ARGS_((void)); /* 159 */
     void *reserved160;
Index: generic/tclLink.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclLink.c,v
retrieving revision 1.7
diff -u -r1.7 tclLink.c
--- generic/tclLink.c	20 Mar 2002 22:47:36 -0000	1.7
+++ generic/tclLink.c	16 Jul 2002 19:24:19 -0000
@@ -60,8 +60,8 @@
  */
 
 static char *		LinkTraceProc _ANSI_ARGS_((ClientData clientData,
-			    Tcl_Interp *interp, char *name1, CONST char *name2,
-			    int flags));
+			    Tcl_Interp *interp, CONST char *name1, 
+                            CONST char *name2, int flags));
 static Tcl_Obj *	ObjValue _ANSI_ARGS_((Link *linkPtr));
 
 /*
@@ -229,7 +229,7 @@
 LinkTraceProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Contains information about the link. */
     Tcl_Interp *interp;		/* Interpreter containing Tcl variable. */
-    char *name1;		/* First part of variable name. */
+    CONST char *name1;		/* First part of variable name. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Miscellaneous additional information. */
 {
Index: generic/tclUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclUtil.c,v
retrieving revision 1.32
diff -u -r1.32 tclUtil.c
--- generic/tclUtil.c	25 Jun 2002 08:59:36 -0000	1.32
+++ generic/tclUtil.c	16 Jul 2002 19:24:20 -0000
@@ -1878,7 +1878,7 @@
 TclPrecTraceProc(clientData, interp, name1, name2, flags)
     ClientData clientData;	/* Not used. */
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *name1;		/* Name of variable. */
+    CONST char *name1;		/* Name of variable. */
     CONST char *name2;		/* Second part of variable name. */
     int flags;			/* Information about what happened. */
 {
Index: generic/tclVar.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclVar.c,v
retrieving revision 1.56
diff -u -r1.56 tclVar.c
--- generic/tclVar.c	16 Jul 2002 16:29:07 -0000	1.56
+++ generic/tclVar.c	16 Jul 2002 19:24:23 -0000
@@ -43,13 +43,13 @@
  */
 
 static int		CallVarTraces _ANSI_ARGS_((Interp *iPtr, Var *arrayPtr,
-			    Var *varPtr, char *part1, CONST char *part2,
+			    Var *varPtr, CONST char *part1, CONST char *part2,
 			    int flags, CONST int leaveErrMsg));
 static void		CleanupVar _ANSI_ARGS_((Var *varPtr,
 			    Var *arrayPtr));
 static void		DeleteSearches _ANSI_ARGS_((Var *arrayVarPtr));
 static void		DeleteArray _ANSI_ARGS_((Interp *iPtr,
-			    char *arrayName, Var *varPtr, int flags));
+			    CONST char *arrayName, Var *varPtr, int flags));
 static void		DisposeTraceResult _ANSI_ARGS_((int flags,
 			    char *result));
 static int              ObjMakeUpvar _ANSI_ARGS_((Tcl_Interp *interp, 
@@ -87,13 +87,13 @@
 int		TclObjUnsetVar2 _ANSI_ARGS_((Tcl_Interp *interp,
 		    Tcl_Obj *part1Ptr, CONST char *part2, int flags));
 Tcl_Obj *	TclPtrGetVar _ANSI_ARGS_((Tcl_Interp *interp, Var *varPtr,
-		    Var *arrayPtr, char *part1, CONST char *part2,
+		    Var *arrayPtr, CONST char *part1, CONST char *part2,
 		    CONST int flags));
 Tcl_Obj *	TclPtrSetVar _ANSI_ARGS_((Tcl_Interp *interp, Var *varPtr,
-		    Var *arrayPtr, char *part1, CONST char *part2,
+		    Var *arrayPtr, CONST char *part1, CONST char *part2,
 		    Tcl_Obj *newValuePtr, CONST int flags));
 Tcl_Obj *	TclPtrIncrVar _ANSI_ARGS_((Tcl_Interp *interp, Var *varPtr,
-		    Var *arrayPtr, char *part1, CONST char *part2,
+		    Var *arrayPtr, CONST char *part1, CONST char *part2,
 		    CONST long i, CONST int flags));
 
 static Tcl_FreeInternalRepProc FreeLocalVarName;
@@ -200,7 +200,7 @@
 TclLookupVar(interp, part1, part2, flags, msg, createPart1, createPart2,
         arrayPtrPtr)
     Tcl_Interp *interp;		/* Interpreter to use for lookup. */
-    register char *part1;	/* If part2 isn't NULL, this is the name of
+    CONST char *part1;	        /* If part2 isn't NULL, this is the name of
 				 * an array. Otherwise, this
 				 * is a full variable name that could
 				 * include a parenthesized array element. */
@@ -224,19 +224,21 @@
     Var *varPtr;
     CONST char *elName;		/* Name of array element or NULL; may be
 				 * same as part2, or may be openParen+1. */
-    char *openParen, *closeParen;
+    int openParen, closeParen;
                                 /* If this procedure parses a name into
-				 * array and index, these point to the
-				 * parens around the index.  Otherwise they
-				 * are NULL. These are needed to restore
-				 * the parens after parsing the name. */
-    register char *p;
+				 * array and index, these are the offsets to 
+				 * the parens around the index.  Otherwise 
+				 * they are -1. */
+    register CONST char *p;
     CONST char *errMsg = NULL;
     int index;
+#define VAR_NAME_BUF_SIZE 26
+    char buffer[VAR_NAME_BUF_SIZE];
+    char *newVarName = buffer;
 
     varPtr = NULL;
     *arrayPtrPtr = NULL;
-    openParen = closeParen = NULL;
+    openParen = closeParen = -1;
 
     /*
      * Parse part1 into array name and index.
@@ -251,29 +253,35 @@
     elName = part2;
     for (p = part1; *p ; p++) {
 	if (*p == '(') {
-	    openParen = p;
+	    openParen = p - part1;
 	    do {
 		p++;
 	    } while (*p != '\0');
 	    p--;
 	    if (*p == ')') {
 		if (part2 != NULL) {
-		    openParen = NULL;
 		    if (flags & TCL_LEAVE_ERR_MSG) {
 			VarErrMsg(interp, part1, part2, msg, needArray);
 		    }
-		    goto done;
+		    return NULL;
 		}
-		closeParen = p;
-		*openParen = 0;
-		*closeParen = 0;
-		elName = openParen+1;
+		closeParen = p - part1;
 	    } else {
-		openParen = NULL;
+		openParen = -1;
 	    }
 	    break;
 	}
     }
+    if (openParen != -1) {
+	if (closeParen >= VAR_NAME_BUF_SIZE) {
+	    newVarName = ckalloc((unsigned int) (closeParen+1));
+	}
+	memcpy(newVarName, part1, (unsigned int) closeParen);
+	newVarName[openParen] = '\0';
+	newVarName[closeParen] = '\0';
+	part1 = newVarName;
+	elName = newVarName + openParen + 1;
+    }
 
     varPtr = TclLookupSimpleVar(interp, part1, flags, 
             createPart1, &errMsg, &index);
@@ -281,7 +289,7 @@
 	if ((errMsg != NULL) && (flags & TCL_LEAVE_ERR_MSG)) {
 	    VarErrMsg(interp, part1, elName, msg, errMsg);
 	}
-	return NULL;
+	goto done;
     }
 
     while (TclIsVarLink(varPtr)) {
@@ -294,12 +302,14 @@
     varPtr = TclLookupArrayElement(interp, part1, elName, flags, 
             msg, createPart1, createPart2, varPtr);
 
-    done:
-    if (openParen != NULL) {
-        *openParen = '(';
-	*closeParen = ')';
+ done:
+    if (newVarName != buffer) {
+	ckfree(newVarName);
     }
+
     return varPtr;
+	
+#undef VAR_NAME_BUF_SIZE
 }
 
 /*
@@ -984,7 +994,7 @@
 Tcl_GetVar(interp, varName, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
 				 * to be looked up. */
-    char *varName;		/* Name of a variable in interp. */
+    CONST char *varName;	/* Name of a variable in interp. */
     int flags;			/* OR-ed combination of TCL_GLOBAL_ONLY,
 				 * TCL_NAMESPACE_ONLY or TCL_LEAVE_ERR_MSG
 				 * bits. */
@@ -1019,7 +1029,7 @@
 Tcl_GetVar2(interp, part1, part2, flags)
     Tcl_Interp *interp;		/* Command interpreter in which variable is
 				 * to be looked up. */
-    char *part1;		/* Name of an array (if part2 is non-NULL)
+    CONST char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
     CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
@@ -1063,7 +1073,7 @@
 Tcl_GetVar2Ex(interp, part1, part2, flags)
     Tcl_Interp *interp;		/* Command interpreter in which variable is
 				 * to be looked up. */
-    char *part1;		/* Name of an array (if part2 is non-NULL)
+    CONST char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
     CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
@@ -1174,7 +1184,7 @@
     register Var *varPtr;       /* The variable to be read.*/
     Var *arrayPtr;              /* NULL for scalar variables, pointer to
 				 * the containing array otherwise. */
-    char *part1;		/* Name of an array (if part2 is non-NULL)
+    CONST char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
     CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
@@ -1583,7 +1593,7 @@
 Tcl_SetVar(interp, varName, newValue, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
 				 * to be looked up. */
-    char *varName;		/* Name of a variable in interp. */
+    CONST char *varName;	/* Name of a variable in interp. */
     CONST char *newValue;	/* New value for varName. */
     int flags;			/* Various flags that tell how to set value:
 				 * any of TCL_GLOBAL_ONLY,
@@ -1624,7 +1634,7 @@
 Tcl_SetVar2(interp, part1, part2, newValue, flags)
     Tcl_Interp *interp;         /* Command interpreter in which variable is
                                  * to be looked up. */
-    char *part1;                /* If part2 is NULL, this is name of scalar
+    CONST char *part1;          /* If part2 is NULL, this is name of scalar
                                  * variable. Otherwise it is the name of
                                  * an array. */
     CONST char *part2;		/* Name of an element within an array, or
@@ -1697,7 +1707,7 @@
 Tcl_SetVar2Ex(interp, part1, part2, newValuePtr, flags)
     Tcl_Interp *interp;		/* Command interpreter in which variable is
 				 * to be found. */
-    char *part1;		/* Name of an array (if part2 is non-NULL)
+    CONST char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
     CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
@@ -1808,7 +1818,7 @@
 				 * to be looked up. */
     register Var *varPtr;
     Var *arrayPtr;
-    char *part1;		/* Name of an array (if part2 is non-NULL)
+    CONST char *part1;		/* Name of an array (if part2 is non-NULL)
 				 * or the name of a variable. */
     CONST char *part2;		/* If non-NULL, gives the name of an element
 				 * in the array part1. */
@@ -2569,7 +2579,7 @@
 				 * to be found. */
     Var *varPtr;
     Var *arrayPtr;
-    char *part1;		/* Points to an object holding the name of
+    CONST char *part1;		/* Points to an object holding the name of
 				 * an array (if part2 is non-NULL) or the
 				 * name of a variable. */
     CONST char *part2;		/* If non-null, points to an object holding
@@ -2883,7 +2893,7 @@
 Tcl_UnsetVar(interp, varName, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
 				 * to be looked up. */
-    char *varName;		/* Name of a variable in interp.  May be
+    CONST char *varName;	/* Name of a variable in interp.  May be
 				 * either a scalar name or an array name
 				 * or an element in an array. */
     int flags;			/* OR-ed combination of any of
@@ -2918,7 +2928,7 @@
 Tcl_UnsetVar2(interp, part1, part2, flags)
     Tcl_Interp *interp;		/* Command interpreter in which varName is
 				 * to be looked up. */
-    char *part1;		/* Name of variable or array. */
+    CONST char *part1;		/* Name of variable or array. */
     CONST char *part2;		/* Name of element within array or NULL. */
     int flags;			/* OR-ed combination of any of
 				 * TCL_GLOBAL_ONLY, TCL_NAMESPACE_ONLY,
@@ -3130,7 +3140,7 @@
 Tcl_TraceVar(interp, varName, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter in which variable is
 				 * to be traced. */
-    char *varName;		/* Name of variable;  may end with "(index)"
+    CONST char *varName;	/* Name of variable;  may end with "(index)"
 				 * to signify an array reference. */
     int flags;			/* OR-ed collection of bits, including any
 				 * of TCL_TRACE_READS, TCL_TRACE_WRITES,
@@ -3169,7 +3179,7 @@
 Tcl_TraceVar2(interp, part1, part2, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter in which variable is
 				 * to be traced. */
-    char *part1;		/* Name of scalar variable or array. */
+    CONST char *part1;		/* Name of scalar variable or array. */
     CONST char *part2;		/* Name of element within array;  NULL means
 				 * trace applies to scalar variable or array
 				 * as-a-whole. */
@@ -3247,7 +3257,7 @@
 void
 Tcl_UntraceVar(interp, varName, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *varName;		/* Name of variable; may end with "(index)"
+    CONST char *varName;	/* Name of variable; may end with "(index)"
 				 * to signify an array reference. */
     int flags;			/* OR-ed collection of bits describing
 				 * current trace, including any of
@@ -3281,7 +3291,7 @@
 void
 Tcl_UntraceVar2(interp, part1, part2, flags, proc, clientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *part1;		/* Name of variable or array. */
+    CONST char *part1;		/* Name of variable or array. */
     CONST char *part2;		/* Name of element within array;  NULL means
 				 * trace applies to scalar variable or array
 				 * as-a-whole. */
@@ -3392,7 +3402,7 @@
 ClientData
 Tcl_VarTraceInfo(interp, varName, flags, proc, prevClientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *varName;		/* Name of variable;  may end with "(index)"
+    CONST char *varName;	/* Name of variable;  may end with "(index)"
 				 * to signify an array reference. */
     int flags;			/* OR-ed combo or TCL_GLOBAL_ONLY,
 				 * TCL_NAMESPACE_ONLY (can be 0). */
@@ -3427,7 +3437,7 @@
 ClientData
 Tcl_VarTraceInfo2(interp, part1, part2, flags, proc, prevClientData)
     Tcl_Interp *interp;		/* Interpreter containing variable. */
-    char *part1;		/* Name of variable or array. */
+    CONST char *part1;		/* Name of variable or array. */
     CONST char *part2;		/* Name of element within array;  NULL means
 				 * trace applies to scalar variable or array
 				 * as-a-whole. */
@@ -4587,7 +4597,7 @@
 				 * to be looked up. */
     CONST char *frameName;	/* Name of the frame containing the source
 				 * variable, such as "1" or "#0". */
-    char *varName;		/* Name of a variable in interp to link to.
+    CONST char *varName;	/* Name of a variable in interp to link to.
 				 * May be either a scalar name or an
 				 * element in an array. */
     CONST char *localName;	/* Name of link variable. */
@@ -4624,7 +4634,7 @@
 				 * for error messages too. */
     CONST char *frameName;	/* Name of the frame containing the source
 				 * variable, such as "1" or "#0". */
-    char *part1;
+    CONST char *part1;
     CONST char *part2;		/* Two parts of source variable name to
 				 * link to. */
     CONST char *localName;	/* Name of link variable. */
@@ -5064,7 +5074,7 @@
 				 * isn't an element of an array. */
     Var *varPtr;		/* Variable whose traces are to be
 				 * invoked. */
-    char *part1;
+    CONST char *part1;
     CONST char *part2;		/* Variable's two-part name. */
     int flags;			/* Flags passed to trace procedures:
 				 * indicates what's happening to variable,
@@ -5077,7 +5087,8 @@
 {
     register VarTrace *tracePtr;
     ActiveVarTrace active;
-    char *result, *openParen, *p;
+    char *result;
+    CONST char *openParen, *p;
     Tcl_DString nameCopy;
     int copiedName;
     int code = TCL_OK;
@@ -5117,11 +5128,13 @@
 		p--;
 		if (*p == ')') {
 		    int offset = (openParen - part1);
+		    char *newPart1;
 		    Tcl_DStringInit(&nameCopy);
 		    Tcl_DStringAppend(&nameCopy, part1, (p-part1));
-		    part2 = Tcl_DStringValue(&nameCopy) + offset + 1;
-		    part1 = Tcl_DStringValue(&nameCopy);
-		    part1[offset] = 0;
+		    newPart1 = Tcl_DStringValue(&nameCopy);
+		    newPart1[offset] = 0;
+		    part1 = newPart1;
+		    part2 = newPart1 + offset + 1;
 		    copiedName = 1;
 		}
 		break;
@@ -5733,7 +5746,7 @@
 static void
 DeleteArray(iPtr, arrayName, varPtr, flags)
     Interp *iPtr;			/* Interpreter containing array. */
-    char *arrayName;			/* Name of array (used for trace
+    CONST char *arrayName;	        /* Name of array (used for trace
 					 * callbacks). */
     Var *varPtr;			/* Pointer to variable structure. */
     int flags;				/* Flags to pass to CallVarTraces:
@@ -5892,7 +5905,7 @@
 Var *
 TclVarTraceExists(interp, varName)
     Tcl_Interp *interp;		/* The interpreter */
-    char *varName;		/* The variable name */
+    CONST char *varName;	/* The variable name */
 {
     Var *varPtr;
     Var *arrayPtr;
