Subject: fix broken lset tests, now all test-cases pass!

From: "jan.nijtmans" <[email-masked]>
Date: Tue, 5 Feb 2013 13:26:07 +0000

---
 generic/tclListObj.c   | 25 ++++++++++---------------
 generic/tclStringObj.c |  2 +-
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index a6985e0..2da3d85 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -1448,10 +1448,6 @@ TclLsetFlat(
 	     * of all containing lists.
 	     */
 
-	    if ((objPtr)->internalRep.twoPtrValue.ptr2) {
-		ckfree((objPtr)->internalRep.twoPtrValue.ptr2);
-		(objPtr)->internalRep.twoPtrValue.ptr2 = NULL;
-	    }
 	    Tcl_InvalidateStringRep(objPtr);
 	}
 
@@ -1643,11 +1639,10 @@ FreeListInternalRep(
 	ckfree((char *) listRepPtr);
     }
 
-	if (listPtr->internalRep.twoPtrValue.ptr2) {
-	    ckfree(listPtr->internalRep.twoPtrValue.ptr2);
-	    listPtr->internalRep.twoPtrValue.ptr2 = NULL;
-	}
-
+    if (listPtr->internalRep.twoPtrValue.ptr2) {
+	ckfree(listPtr->internalRep.twoPtrValue.ptr2);
+	listPtr->internalRep.twoPtrValue.ptr2 = NULL;
+    }
     listPtr->typePtr = NULL;
 }
 
@@ -1798,12 +1793,12 @@ SetListFromAny(
  	listRepPtr->elemCount = elemPtrs - &listRepPtr->elements;
     }
 
-	/* If previous objType was string, keep the internal representation */
-	if (objPtr->typePtr == &tclStringType) {
-		stringIntRep = objPtr->internalRep.twoPtrValue.ptr1;
-	} else {
-	    TclFreeIntRep(objPtr);
-	}
+    /* If previous objType was string, keep the internal representation */
+    if (objPtr->typePtr == &tclStringType) {
+	stringIntRep = objPtr->internalRep.twoPtrValue.ptr1;
+    } else {
+	TclFreeIntRep(objPtr);
+    }
     ListSetIntRep(objPtr, listRepPtr);
     objPtr->internalRep.twoPtrValue.ptr2 = stringIntRep;
     return TCL_OK;
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index b3937e2..ddfd78b 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -417,7 +417,7 @@ Tcl_GetCharLength(
 	Tcl_ObjType *prevtype =  objPtr->typePtr;
 	void *prevdata = objPtr->internalRep.twoPtrValue.ptr1;
 
-	(void)Tcl_GetString(objPtr);
+	(void)TclGetString(objPtr);
 	objPtr->internalRep.twoPtrValue.ptr1 = objPtr->internalRep.twoPtrValue.ptr2;
 	objPtr->typePtr = objPtr->internalRep.twoPtrValue.ptr1 ? &tclStringType: NULL;
 	objPtr->internalRep.twoPtrValue.ptr2 = NULL;
-- 
cgit v0.12