diff options
author | kjnash <k.j.nash@usa.net> | 2022-06-20 01:55:49 (GMT) |
---|---|---|
committer | kjnash <k.j.nash@usa.net> | 2022-06-20 01:55:49 (GMT) |
commit | 74adbfe1bcb9a3e7e114691393b7aa56eaa51673 (patch) | |
tree | 9fbb21cc9c8d5da1bc745ee24a5f282b8df94124 /generic/tclTestObj.c | |
parent | cd11a370748a0056f5d6968020773382050d3d6e (diff) | |
parent | d2cb5714faa8e3c9f583924a3f9a345d915aadd9 (diff) | |
download | tcl-74adbfe1bcb9a3e7e114691393b7aa56eaa51673.zip tcl-74adbfe1bcb9a3e7e114691393b7aa56eaa51673.tar.gz tcl-74adbfe1bcb9a3e7e114691393b7aa56eaa51673.tar.bz2 |
Merge core-8-6-branch
Diffstat (limited to 'generic/tclTestObj.c')
-rw-r--r-- | generic/tclTestObj.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/generic/tclTestObj.c b/generic/tclTestObj.c index 3fe9d02..b1a0afa 100644 --- a/generic/tclTestObj.c +++ b/generic/tclTestObj.c @@ -1184,7 +1184,7 @@ TeststringobjCmd( Tcl_Obj **varPtr; static const char *const options[] = { "append", "appendstrings", "get", "get2", "length", "length2", - "set", "set2", "setlength", "maxchars", "getunicode", + "set", "set2", "setlength", "maxchars", "range", "getunicode", "appendself", "appendself2", NULL }; @@ -1350,13 +1350,25 @@ TeststringobjCmd( } Tcl_SetIntObj(Tcl_GetObjResult(interp), length); break; - case 10: /* getunicode */ + case 10: { /* range */ + int first, last; + if (objc != 5) { + goto wrongNumArgs; + } + if ((Tcl_GetIntFromObj(interp, objv[3], &first) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[4], &last) != TCL_OK)) { + return TCL_ERROR; + } + Tcl_SetObjResult(interp, Tcl_GetRange(varPtr[varIndex], first, last)); + break; + } + case 11: /* getunicode */ if (objc != 3) { goto wrongNumArgs; } Tcl_GetUnicodeFromObj(varPtr[varIndex], NULL); break; - case 11: /* appendself */ + case 12: /* appendself */ if (objc != 4) { goto wrongNumArgs; } @@ -1387,7 +1399,7 @@ TeststringobjCmd( Tcl_AppendToObj(varPtr[varIndex], string + i, length - i); Tcl_SetObjResult(interp, varPtr[varIndex]); break; - case 12: /* appendself2 */ + case 13: /* appendself2 */ if (objc != 4) { goto wrongNumArgs; } |