diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-07-12 18:04:33 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-07-12 18:04:33 (GMT) |
commit | 02457f7d6507f76fac8b308899e6592ab8214cb3 (patch) | |
tree | 84e622e144e045fb36d18b1ef70c6561ee1a920f /generic/tclUtil.c | |
parent | fde10a8fbff3c774f95f668f51b6d60c1489d50d (diff) | |
download | tcl-02457f7d6507f76fac8b308899e6592ab8214cb3.zip tcl-02457f7d6507f76fac8b308899e6592ab8214cb3.tar.gz tcl-02457f7d6507f76fac8b308899e6592ab8214cb3.tar.bz2 |
Fix [Bug 2637173] by consolidating bytearray purity check.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 881edca..862470f 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.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: tclUtil.c,v 1.110 2009/02/25 19:59:52 dgp Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.111 2009/07/12 18:04:33 dkf Exp $ */ #include "tclInt.h" @@ -1747,9 +1747,10 @@ TclByteArrayMatch( int TclStringMatchObj( - Tcl_Obj *strObj, /* string object. */ - Tcl_Obj *ptnObj, /* pattern object. */ - int flags) /* Only TCL_MATCH_NOCASE should be passed or 0. */ + Tcl_Obj *strObj, /* string object. */ + Tcl_Obj *ptnObj, /* pattern object. */ + int flags) /* Only TCL_MATCH_NOCASE should be passed, or + * 0. */ { int match, length, plen; @@ -1766,8 +1767,7 @@ TclStringMatchObj( udata = Tcl_GetUnicodeFromObj(strObj, &length); uptn = Tcl_GetUnicodeFromObj(ptnObj, &plen); match = TclUniCharMatch(udata, length, uptn, plen, flags); - } else if ((strObj->typePtr == &tclByteArrayType) - && (strObj->bytes == NULL) && !flags) { + } else if (TclIsPureByteArray(strObj) && !flags) { unsigned char *data, *ptn; data = Tcl_GetByteArrayFromObj(strObj, &length); |