diff options
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 1b943a6..aceaa7a 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclListObj.c,v 1.3 1998/10/13 20:30:23 rjohnson Exp $ + * RCS: @(#) $Id: tclListObj.c,v 1.4 1999/04/16 00:46:50 stanton Exp $ */ #include "tclInt.h" @@ -239,11 +239,13 @@ Tcl_SetListObj(objPtr, objc, objv) Tcl_InvalidateStringRep(objPtr); if ((oldTypePtr != NULL) && (oldTypePtr->freeIntRepProc != NULL)) { oldTypePtr->freeIntRepProc(objPtr); - objPtr->typePtr = NULL; } + objPtr->typePtr = NULL; /* * Set the object's type to "list" and initialize the internal rep. + * However, if there are no elements to put in the list, just give + * the object an empty string rep and a NULL type. */ if (objc > 0) { @@ -877,10 +879,11 @@ SetListFromAny(interp, objPtr) Tcl_Obj *objPtr; /* The object to convert. */ { Tcl_ObjType *oldTypePtr = objPtr->typePtr; - char *string, *elemStart, *nextElem, *s; + char *string, *s; + CONST char *elemStart, *nextElem; int lenRemain, length, estCount, elemSize, hasBrace, i, j, result; char *limit; /* Points just after string's last byte. */ - register char *p; + register CONST char *p; register Tcl_Obj **elemPtrs; register Tcl_Obj *elemPtr; List *listRepPtr; @@ -889,7 +892,7 @@ SetListFromAny(interp, objPtr) * Get the string representation. Make it up-to-date if necessary. */ - string = TclGetStringFromObj(objPtr, &length); + string = Tcl_GetStringFromObj(objPtr, &length); /* * Parse the string into separate string objects, and create a List @@ -903,7 +906,7 @@ SetListFromAny(interp, objPtr) limit = (string + length); estCount = 1; for (p = string; p < limit; p++) { - if (isspace(UCHAR(*p))) { + if (isspace(UCHAR(*p))) { /* INTL: ISO space. */ estCount++; } } |