From 63678d528b5d4384d8a6fd8941b73888399227e5 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 26 Nov 2014 16:22:40 +0000 Subject: I like this patch better. Retain the byte orientation of the parser. --- generic/tclParse.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/generic/tclParse.c b/generic/tclParse.c index 1523eb3..90ec43d 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -1344,8 +1344,7 @@ Tcl_ParseVarName( Tcl_Token *tokenPtr; register const char *src; unsigned char c; - int varIndex, offset; - Tcl_UniChar ch; + int varIndex; unsigned array; if ((numBytes == 0) || (start == NULL)) { @@ -1428,22 +1427,10 @@ Tcl_ParseVarName( tokenPtr->numComponents = 0; while (numBytes) { - if (Tcl_UtfCharComplete(src, numBytes)) { - offset = Tcl_UtfToUniChar(src, &ch); - } else { - char utfBytes[TCL_UTF_MAX]; - - memcpy(utfBytes, src, (size_t) numBytes); - utfBytes[numBytes] = '\0'; - offset = Tcl_UtfToUniChar(utfBytes, &ch); - } - c = UCHAR(ch); - if (c != ch) { - break; - } + c = UCHAR(*src); if (isalnum(c) || (c == '_')) { /* INTL: ISO only, UCHAR. */ - src += offset; - numBytes -= offset; + src += 1; + numBytes -= 1; continue; } if ((c == ':') && (numBytes != 1) && (src[1] == ':')) { -- cgit v0.12