summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-02-25 19:59:30 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-02-25 19:59:30 (GMT)
commitcef4c16d5ab82ead5e327bd9a97a69f7e4b7e2c2 (patch)
tree7917127004ee2a988bf39047012612568e615fd2 /generic/tclUtil.c
parent57ca69ee1a85fea74e73766265b67cc85d74081d (diff)
downloadtcl-cef4c16d5ab82ead5e327bd9a97a69f7e4b7e2c2.zip
tcl-cef4c16d5ab82ead5e327bd9a97a69f7e4b7e2c2.tar.gz
tcl-cef4c16d5ab82ead5e327bd9a97a69f7e4b7e2c2.tar.bz2
* generic/tclUtil.c (TclStringMatchObj): Revised the branching
on the strObj->typePtr so that untyped values get converted to the "string" type and pass through the Unicode matcher. [Bug 2613766] Also added checks to only perform "bytearray" optimization on pure bytearray values. [Bug 2637173].
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 9ea54b0..881edca 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.109 2009/02/10 23:09:05 nijtmans Exp $
+ * RCS: @(#) $Id: tclUtil.c,v 1.110 2009/02/25 19:59:52 dgp Exp $
*/
#include "tclInt.h"
@@ -1760,13 +1760,14 @@ TclStringMatchObj(
trivial = nocase ? 0 : TclMatchIsTrivial(TclGetString(ptnObj));
*/
- if ((strObj->typePtr == &tclStringType)) {
+ if ((strObj->typePtr == &tclStringType) || (strObj->typePtr == NULL)) {
Tcl_UniChar *udata, *uptn;
udata = Tcl_GetUnicodeFromObj(strObj, &length);
uptn = Tcl_GetUnicodeFromObj(ptnObj, &plen);
match = TclUniCharMatch(udata, length, uptn, plen, flags);
- } else if ((strObj->typePtr == &tclByteArrayType) && !flags) {
+ } else if ((strObj->typePtr == &tclByteArrayType)
+ && (strObj->bytes == NULL) && !flags) {
unsigned char *data, *ptn;
data = Tcl_GetByteArrayFromObj(strObj, &length);