diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-25 23:38:49 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-25 23:38:49 (GMT) |
| commit | acb9caa95921a281c8b7f34b030deb1c3049281c (patch) | |
| tree | 74302fc20666030f2e2cf87268482a29e0695ccb /generic/tclTestObj.c | |
| parent | 342be44f4da2cc09411fd0dc070ddcab26d87355 (diff) | |
| parent | 03c4df2e30d98d74775a50ee28ce007ae6b41d87 (diff) | |
| download | tcl-acb9caa95921a281c8b7f34b030deb1c3049281c.zip tcl-acb9caa95921a281c8b7f34b030deb1c3049281c.tar.gz tcl-acb9caa95921a281c8b7f34b030deb1c3049281c.tar.bz2 | |
merge novem
Diffstat (limited to 'generic/tclTestObj.c')
| -rw-r--r-- | generic/tclTestObj.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index c86eb9f..bc1834f 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -172,8 +172,8 @@ TestbignumobjCmd( Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[1], subcmds, "option", 0, - &index) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcmds, + sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } string = Tcl_GetString(objv[2]); @@ -554,11 +554,12 @@ TestindexobjCmd( return TCL_ERROR; } - Tcl_GetIndexFromObj(NULL, objv[1], tablePtr, "token", 0, &index); + Tcl_GetIndexFromObjStruct(NULL, objv[1], tablePtr, + sizeof(char *), "token", 0, &index); indexRep = objv[1]->internalRep.otherValuePtr; indexRep->index = index2; - result = Tcl_GetIndexFromObj(NULL, objv[1], - tablePtr, "token", 0, &index); + result = Tcl_GetIndexFromObjStruct(NULL, objv[1], + tablePtr, sizeof(char *), "token", 0, &index); if (result == TCL_OK) { Tcl_SetIntObj(Tcl_GetObjResult(interp), index); } @@ -598,8 +599,8 @@ TestindexobjCmd( } } - result = Tcl_GetIndexFromObj((setError? interp : NULL), objv[3], - argv, "token", (allowAbbrev? 0 : TCL_EXACT), &index); + result = Tcl_GetIndexFromObjStruct((setError? interp : NULL), objv[3], + argv, sizeof(char *), "token", (allowAbbrev? 0 : TCL_EXACT), &index); ckfree(argv); if (result == TCL_OK) { Tcl_SetIntObj(Tcl_GetObjResult(interp), index); @@ -864,8 +865,8 @@ TestlistobjCmd( if (GetVariableIndex(interp, index, &varIndex) != TCL_OK) { return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[1], subcommands, "command", - 0, &cmdIndex) != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[1], subcommands, + sizeof(char *), "command", 0, &cmdIndex) != TCL_OK) { return TCL_ERROR; } switch(cmdIndex) { @@ -963,6 +964,17 @@ TestobjCmd( } SetVarToObj(varPtr, destIndex, varPtr[varIndex]); Tcl_SetObjResult(interp, varPtr[destIndex]); + } else if (strcmp(subCmd, "bug3598580") == 0) { + Tcl_Obj *listObjPtr, *elemObjPtr; + if (objc != 2) { + goto wrongNumArgs; + } + elemObjPtr = Tcl_NewIntObj(123); + listObjPtr = Tcl_NewListObj(1, &elemObjPtr); + /* Replace the single list element through itself, nonsense but legal. */ + Tcl_ListObjReplace(interp, listObjPtr, 0, 1, 1, &elemObjPtr); + Tcl_SetObjResult(interp, listObjPtr); + return TCL_OK; } else if (strcmp(subCmd, "convert") == 0) { const char *typeName; @@ -1150,8 +1162,8 @@ TeststringobjCmd( return TCL_ERROR; } - if (Tcl_GetIndexFromObj(interp, objv[1], options, "option", 0, &option) - != TCL_OK) { + if (Tcl_GetIndexFromObjStruct(interp, objv[1], options, + sizeof(char *), "option", 0, &option) != TCL_OK) { return TCL_ERROR; } switch (option) { |
