diff options
author | hobbs <hobbs> | 2003-02-18 02:25:41 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2003-02-18 02:25:41 (GMT) |
commit | 4ab5c4158044ba81cf3aa93c71d446fddd9c7ca5 (patch) | |
tree | 4897dca0fb72c73e8c8bee4e5d6b292195b07662 /generic/tclExecute.c | |
parent | d86b1af8bec78fdbcc8bf65bc205fd287e19fd5d (diff) | |
download | tcl-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/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 93bf3a9..3333959 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.92 2003/02/06 22:44:57 mdejong Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.93 2003/02/18 02:25:44 hobbs Exp $ */ #include "tclInt.h" @@ -2650,10 +2650,16 @@ TclExecuteByteCode(interp, codePtr) * Check that at least one of the objects is Unicode before * promoting both. */ + if ((valuePtr->typePtr == &tclStringType) || (value2Ptr->typePtr == &tclStringType)) { - match = Tcl_UniCharCaseMatch(Tcl_GetUnicode(valuePtr), - Tcl_GetUnicode(value2Ptr), nocase); + Tcl_UniChar *ustring1, *ustring2; + int length1, length2; + + ustring1 = Tcl_GetUnicodeFromObj(valuePtr, &length1); + ustring2 = Tcl_GetUnicodeFromObj(value2Ptr, &length2); + match = TclUniCharMatch(ustring1, length1, ustring2, length2, + nocase); } else { match = Tcl_StringCaseMatch(TclGetString(valuePtr), TclGetString(value2Ptr), nocase); |