Index: generic/tclLink.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclLink.c,v
retrieving revision 1.8
diff -u -r1.8 tclLink.c
--- generic/tclLink.c	5 Aug 2002 03:24:41 -0000	1.8
+++ generic/tclLink.c	6 Jul 2005 14:52:16 -0000
@@ -236,8 +236,8 @@
     Link *linkPtr = (Link *) clientData;
     int changed, valueLength;
     CONST char *value;
-    char **pp, *result;
-    Tcl_Obj *objPtr, *valueObj;
+    char **pp;
+    Tcl_Obj *valueObj;
 
     /*
      * If the variable is being unset, then just re-create it (with a
@@ -321,56 +321,43 @@
 	return "internal error: linked variable couldn't be read";
     }
 
-    objPtr = Tcl_GetObjResult(interp);
-    Tcl_IncrRefCount(objPtr);
-    Tcl_ResetResult(interp);
-    result = NULL;
-
     switch (linkPtr->type) {
     case TCL_LINK_INT:
-	if (Tcl_GetIntFromObj(interp, valueObj, &linkPtr->lastValue.i)
+	if (Tcl_GetIntFromObj(NULL, valueObj, &linkPtr->lastValue.i)
 		!= TCL_OK) {
-	    Tcl_SetObjResult(interp, objPtr);
 	    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
 		    TCL_GLOBAL_ONLY);
-	    result = "variable must have integer value";
-	    goto end;
+	    return "variable must have integer value";
 	}
 	*(int *)(linkPtr->addr) = linkPtr->lastValue.i;
 	break;
 
     case TCL_LINK_WIDE_INT:
-	if (Tcl_GetWideIntFromObj(interp, valueObj, &linkPtr->lastValue.w)
+	if (Tcl_GetWideIntFromObj(NULL, valueObj, &linkPtr->lastValue.w)
 		!= TCL_OK) {
-	    Tcl_SetObjResult(interp, objPtr);
 	    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
 		    TCL_GLOBAL_ONLY);
-	    result = "variable must have integer value";
-	    goto end;
+	    return "variable must have integer value";
 	}
 	*(Tcl_WideInt *)(linkPtr->addr) = linkPtr->lastValue.w;
 	break;
 
     case TCL_LINK_DOUBLE:
-	if (Tcl_GetDoubleFromObj(interp, valueObj, &linkPtr->lastValue.d)
+	if (Tcl_GetDoubleFromObj(NULL, valueObj, &linkPtr->lastValue.d)
 		!= TCL_OK) {
-	    Tcl_SetObjResult(interp, objPtr);
 	    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
 		    TCL_GLOBAL_ONLY);
-	    result = "variable must have real value";
-	    goto end;
+	    return "variable must have real value";
 	}
 	*(double *)(linkPtr->addr) = linkPtr->lastValue.d;
 	break;
 
     case TCL_LINK_BOOLEAN:
-	if (Tcl_GetBooleanFromObj(interp, valueObj, &linkPtr->lastValue.i)
+	if (Tcl_GetBooleanFromObj(NULL, valueObj, &linkPtr->lastValue.i)
 	    != TCL_OK) {
-	    Tcl_SetObjResult(interp, objPtr);
 	    Tcl_ObjSetVar2(interp, linkPtr->varName, NULL, ObjValue(linkPtr),
 		    TCL_GLOBAL_ONLY);
-	    result = "variable must have boolean value";
-	    goto end;
+	    return "variable must have boolean value";
 	}
 	*(int *)(linkPtr->addr) = linkPtr->lastValue.i;
 	break;
@@ -389,9 +376,7 @@
     default:
 	return "internal error: bad linked variable type";
     }
-    end:
-    Tcl_DecrRefCount(objPtr);
-    return result;
+    return NULL;
 }
 
 /*
