summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-12 15:45:41 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-12 15:45:41 (GMT)
commit0ae103848b50e1fab1089e7c04bed68fac81152f (patch)
treee41fb4f7aea833599e98fc3d90065a70b8e21f52 /unix
parent84be29734969e1c4a15df99cc315e4d192b3d9be (diff)
downloadtcl-0ae103848b50e1fab1089e7c04bed68fac81152f.zip
tcl-0ae103848b50e1fab1089e7c04bed68fac81152f.tar.gz
tcl-0ae103848b50e1fab1089e7c04bed68fac81152f.tar.bz2
Use pkgb_demo to test function Tcl_UtfNcmp()
Diffstat (limited to 'unix')
-rw-r--r--unix/dltest/pkgb.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 2d525bc..a758a06 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -98,7 +98,18 @@ Pkgb_DemoObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetEncodingSearchPath(), -1));
+ Tcl_WideInt numChars;
+ int result;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 1, objv, "arg1 arg2 num");
+ return TCL_ERROR;
+ }
+ if (Tcl_GetWideIntFromObj(interp, objv[3], &numChars) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ result = Tcl_UtfNcmp(Tcl_GetString(objv[1]), Tcl_GetString(objv[2]), numChars);
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
return TCL_OK;
}