summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-02-18 02:25:41 (GMT)
committerhobbs <hobbs>2003-02-18 02:25:41 (GMT)
commit4ab5c4158044ba81cf3aa93c71d446fddd9c7ca5 (patch)
tree4897dca0fb72c73e8c8bee4e5d6b292195b07662 /generic/tclCmdMZ.c
parentd86b1af8bec78fdbcc8bf65bc205fd287e19fd5d (diff)
downloadtcl-4ab5c4158044ba81cf3aa93c71d446fddd9c7ca5.zip
tcl-4ab5c4158044ba81cf3aa93c71d446fddd9c7ca5.tar.gz
tcl-4ab5c4158044ba81cf3aa93c71d446fddd9c7ca5.tar.bz2
* generic/tclExecute.c (TclExecuteByteCode INST_STR_MATCH):
* generic/tclCmdMZ.c (Tcl_StringObjCmd STR_MATCH): * generic/tclUtf.c (TclUniCharMatch): * generic/tclInt.decls: add private TclUniCharMatch function that * generic/tclIntDecls.h: does string match on counted unicode * generic/tclStubInit.c: strings. Tcl_UniCharCaseMatch has the * tests/string.test: failing that it can't handle strings or * tests/stringComp.test: patterns with embedded NULLs. Added tests that actually try strings/pats with NULLs. TclUniCharMatch should be TIPed and made public in the next minor version rev.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index d3deaae..2339965 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.80 2003/01/17 14:19:44 vincentdarley Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.81 2003/02/18 02:25:43 hobbs Exp $
*/
#include "tclInt.h"
@@ -2008,6 +2008,7 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
break;
}
case STR_MATCH: {
+ Tcl_UniChar *ustring1, *ustring2;
int nocase = 0;
if (objc < 4 || objc > 5) {
@@ -2027,10 +2028,10 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
return TCL_ERROR;
}
}
-
- Tcl_SetBooleanObj(resultPtr,
- Tcl_UniCharCaseMatch(Tcl_GetUnicode(objv[objc-1]),
- Tcl_GetUnicode(objv[objc-2]), nocase));
+ ustring1 = Tcl_GetUnicodeFromObj(objv[objc-1], &length1);
+ ustring2 = Tcl_GetUnicodeFromObj(objv[objc-2], &length2);
+ Tcl_SetBooleanObj(resultPtr, TclUniCharMatch(ustring1, length1,
+ ustring2, length2, nocase));
break;
}
case STR_RANGE: {