diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-05-01 07:38:27 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-05-01 07:38:27 (GMT) |
commit | c4f8c1063cb3dd98653536b65b3a9693ebfa9b58 (patch) | |
tree | 4f49557b0fc34ae6f65fc299aaadf9d60bfcc691 /generic/tclUtil.c | |
parent | 87d82b22e75fa7da07ad3a0be6c9cba93fcd1aa2 (diff) | |
download | tcl-c4f8c1063cb3dd98653536b65b3a9693ebfa9b58.zip tcl-c4f8c1063cb3dd98653536b65b3a9693ebfa9b58.tar.gz tcl-c4f8c1063cb3dd98653536b65b3a9693ebfa9b58.tar.bz2 |
Fix more corner-cases like [0e92c404f19ede5b2eb06e6db27647d3138cc56|0e92c404f1]: The only place where a type of &tclByteArrayType can be trusted is when determining its length, because the character length of a (UTF-8) string is always equal to the byte length of the byte array.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 5f4cdae..8c6adfe 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2334,7 +2334,7 @@ TclStringMatchObj( 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 (TclIsPureByteArray(strObj) && !flags) { unsigned char *data, *ptn; data = Tcl_GetByteArrayFromObj(strObj, &length); |