summaryrefslogtreecommitdiffstats
path: root/generic/tclParse.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-11-26 16:22:40 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-11-26 16:22:40 (GMT)
commit63678d528b5d4384d8a6fd8941b73888399227e5 (patch)
treec24ac90ea268477bd0e3c76321cf02fe5fcefd76 /generic/tclParse.c
parent61855b36b423d2293d99ccb6381e6622980e2cd9 (diff)
downloadtcl-63678d528b5d4384d8a6fd8941b73888399227e5.zip
tcl-63678d528b5d4384d8a6fd8941b73888399227e5.tar.gz
tcl-63678d528b5d4384d8a6fd8941b73888399227e5.tar.bz2
I like this patch better. Retain the byte orientation of the parser.
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r--generic/tclParse.c21
1 files 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] == ':')) {