diff options
author | hobbs <hobbs> | 2007-12-11 02:57:38 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2007-12-11 02:57:38 (GMT) |
commit | cf51bd54b5a287a462f703664196dbbfbfc072f1 (patch) | |
tree | e2366f37f9aceb9a418cb4d9a8a7ddfaed064e61 /generic/tclCmdMZ.c | |
parent | be008511dcfa73424dbbe3a12cdf3890759977ba (diff) | |
download | tcl-cf51bd54b5a287a462f703664196dbbfbfc072f1.zip tcl-cf51bd54b5a287a462f703664196dbbfbfc072f1.tar.gz tcl-cf51bd54b5a287a462f703664196dbbfbfc072f1.tar.bz2 |
* generic/tclInt.decls: move TclByteArrayMatch and TclReToGlob
* generic/tclIntDecls.h: to tclInt.h from stubs.
* generic/tclStubInit.c: Add flags var to TclByteArrayMatch for
* generic/tclInt.h: future extensibility
* generic/tcl.h: define TCL_MATCH_EXACT doc for Tcl_StringCaseMatch.
* doc/StrMatch.3: It is compatible with existing usage.
* generic/tclExecute.c (INST_STR_MATCH): flag for TclByteArrayMatch
* generic/tclUtil.c (TclByteArrayMatch, TclStringMatchObj):
* generic/tclRegexp.c (Tcl_RegExpExecObj):
* generic/tclCmdMZ.c (StringMatchCmd): Use TclStringMatchObj
* tests/string.test (11.9.* 11.10.*): more tests
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 0d3a3a8..da03f5a 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,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.161 2007/12/03 13:46:28 dkf Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.162 2007/12/11 02:57:39 hobbs Exp $ */ #include "tclInt.h" @@ -1974,8 +1974,7 @@ StringMatchCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tcl_UniChar *ustring1, *ustring2; - int length1, length2, nocase = 0; + int nocase = 0; if (objc < 3 || objc > 4) { Tcl_WrongNumArgs(interp, 1, objv, "?-nocase? pattern string"); @@ -1983,21 +1982,20 @@ StringMatchCmd( } if (objc == 4) { - const char *string = TclGetStringFromObj(objv[1], &length2); + int length; + const char *string = TclGetStringFromObj(objv[1], &length); - if ((length2 > 1) && - strncmp(string, "-nocase", (size_t) length2) == 0) { - nocase = 1; + if ((length > 1) && + strncmp(string, "-nocase", (size_t) length) == 0) { + nocase = TCL_MATCH_NOCASE; } else { Tcl_AppendResult(interp, "bad option \"", string, "\": must be -nocase", NULL); return TCL_ERROR; } } - ustring1 = Tcl_GetUnicodeFromObj(objv[objc-1], &length1); - ustring2 = Tcl_GetUnicodeFromObj(objv[objc-2], &length2); Tcl_SetObjResult(interp, Tcl_NewBooleanObj( - TclUniCharMatch(ustring1, length1, ustring2, length2, nocase))); + TclStringMatchObj(objv[objc-1], objv[objc-2], nocase))); return TCL_OK; } |