diff options
author | dgp <dgp@noemail.net> | 2003-07-15 23:54:51 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2003-07-15 23:54:51 (GMT) |
commit | 8ca305f6b13aa8494e3fd152600c38a9a5dfaae5 (patch) | |
tree | c19990fa51df8e68bc17cc533b9dc2e1839bac1d /unix/dltest | |
parent | 95161b2352fe77f816b8b2491d98726ced06689d (diff) | |
download | tcl-8ca305f6b13aa8494e3fd152600c38a9a5dfaae5.zip tcl-8ca305f6b13aa8494e3fd152600c38a9a5dfaae5.tar.gz tcl-8ca305f6b13aa8494e3fd152600c38a9a5dfaae5.tar.bz2 |
* unix/dltest/pkga.c: Updated to not use Tcl_UtfNcmp and counted
strings instead of strcmp (not defined in any #include'd header)
and presumed NULL-terminated strings.
FossilOrigin-Name: 2f48ff2f8087c4b3461f8c06788200425aa41d4b
Diffstat (limited to 'unix/dltest')
-rw-r--r-- | unix/dltest/pkga.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c index 35bc95c..7fb9524 100644 --- a/unix/dltest/pkga.c +++ b/unix/dltest/pkga.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: pkga.c,v 1.4 2000/04/04 08:06:07 hobbs Exp $ + * RCS: @(#) $Id: pkga.c,v 1.4.24.1 2003/07/15 23:54:53 dgp Exp $ */ #include "tcl.h" @@ -48,13 +48,21 @@ Pkga_EqObjCmd(dummy, interp, objc, objv) Tcl_Obj * CONST objv[]; /* Argument objects. */ { int result; + CONST char *str1, str2; + int len1, len2, n; if (objc != 3) { Tcl_WrongNumArgs(interp, 1, objv, "string1 string2"); return TCL_ERROR; } - result = !strcmp(Tcl_GetString(objv[1]), Tcl_GetString(objv[2])); + str1 = Tcl_GetStringFromObj(objv[1], &len1); + str2 = Tcl_GetStringFromObj(objv[2], &len2); + if (len1 == len2) { + result = (Tcl_UtfNcmp(str1, str2, len1) == 0); + } else { + result = 0; + } Tcl_SetObjResult(interp, Tcl_NewIntObj(result)); return TCL_OK; } |