diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-11-01 11:11:42 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-11-01 11:11:42 (GMT) |
commit | 2b649ba9103839c6ddefe1dae22a795915b6c654 (patch) | |
tree | c144a8963de5dffd6685d2e1acb7631424d263db /generic | |
parent | b63e2b17063b770287357b30d1839c8df4e7eeb1 (diff) | |
download | tcl-2b649ba9103839c6ddefe1dae22a795915b6c654.zip tcl-2b649ba9103839c6ddefe1dae22a795915b6c654.tar.gz tcl-2b649ba9103839c6ddefe1dae22a795915b6c654.tar.bz2 |
\u0000 is ASCII! [Bug 1808258]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclCmdMZ.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index c241cf3..c1d54ff 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,11 +15,13 @@ * 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.155 2007/10/11 21:35:00 dgp Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.156 2007/11/01 11:11:44 dkf Exp $ */ #include "tclInt.h" #include "tclRegexp.h" + +static int UniCharIsAscii(int character); /* *---------------------------------------------------------------------- @@ -1489,18 +1491,7 @@ Tcl_StringObjCmd( chcomp = Tcl_UniCharIsAlpha; break; case STR_IS_ASCII: - for (; string1 < end; string1++, failat++) { - /* - * This is a valid check in unicode, because all bytes less - * than 0xC0 are single byte chars (but isascii limits that - * def'n to 0x80). - */ - - if (*((unsigned char *)string1) >= 0x80) { - result = 0; - break; - } - } + chcomp = UniCharIsAscii; break; case STR_IS_BOOL: case STR_IS_TRUE: @@ -2446,6 +2437,13 @@ Tcl_StringObjCmd( return TCL_OK; } +static int +UniCharIsAscii( + int character) +{ + return (character >= 0) && (character < 0x80); +} + /* *---------------------------------------------------------------------- * |