summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-07-15 23:57:33 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-07-15 23:57:33 (GMT)
commit6e2755b218e6f9902e0b316830c39c1308aaf748 (patch)
treeb5dd9637844290dee0860417da3653b42f068677
parentda4f00b003469298b4cdf2bd2f0ab8646e2ec8ba (diff)
downloadtcl-6e2755b218e6f9902e0b316830c39c1308aaf748.zip
tcl-6e2755b218e6f9902e0b316830c39c1308aaf748.tar.gz
tcl-6e2755b218e6f9902e0b316830c39c1308aaf748.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.
-rw-r--r--ChangeLog4
-rw-r--r--unix/dltest/pkga.c12
2 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 668ca33..31002aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@
2003-07-15 Don Porter <dgp@users.sourceforge.net>
+ * 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.
+
* generic/tclCompCmds.c (TclCompileIfCmd): Prior fix of Bug 711371
on 2003-04-07 introduced a buffer overflow. Corrected. [Bug 771613]
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c
index 24c2582..9957158 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.5 2003/03/26 20:02:18 dgp Exp $
+ * RCS: @(#) $Id: pkga.c,v 1.6 2003/07/15 23:57:33 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;
}