diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-28 10:39:50 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-28 10:39:50 (GMT) |
| commit | 947369a720dc58ad94435918a85bee712448a48e (patch) | |
| tree | 130e81956048945337c1a55693832518e2897ed7 /generic/tclStringObj.c | |
| parent | 94a0658bc2c711a2e464dfc5a7dc3fd0b233fa82 (diff) | |
| parent | f6bf85fb67eb15e637ecf7c7de4f661dc0557b43 (diff) | |
| download | tcl-947369a720dc58ad94435918a85bee712448a48e.zip tcl-947369a720dc58ad94435918a85bee712448a48e.tar.gz tcl-947369a720dc58ad94435918a85bee712448a48e.tar.bz2 | |
Merge 8.6
Diffstat (limited to 'generic/tclStringObj.c')
| -rw-r--r-- | generic/tclStringObj.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 7486631..66647f0 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -2443,10 +2443,10 @@ Tcl_AppendFormatToObj( goto errorMsg; } if (ch == 'A') { - char *p = TclGetString(segment) + 1; - *p = 'x'; - p = strchr(p, 'P'); - if (p) *p = 'p'; + char *q = TclGetString(segment) + 1; + *q = 'x'; + q = strchr(q, 'P'); + if (q) *q = 'p'; } break; } @@ -3561,7 +3561,7 @@ TclStringFirst( int lh, ln = Tcl_GetCharLength(needle); Tcl_Obj *result; int value = -1; - Tcl_UniChar *check, *end, *uh, *un; + Tcl_UniChar *checkStr, *endStr, *uh, *un; if (start < 0) { start = 0; @@ -3627,12 +3627,12 @@ TclStringFirst( /* Don't start the loop if there cannot be a valid answer */ goto firstEnd; } - end = uh + lh; + endStr = uh + lh; - for (check = uh + start; check + ln <= end; check++) { - if ((*check == *un) && (0 == - memcmp(check + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) { - value = (check - uh); + for (checkStr = uh + start; checkStr + ln <= endStr; checkStr++) { + if ((*checkStr == *un) && (0 == + memcmp(checkStr + 1, un + 1, (ln-1) * sizeof(Tcl_UniChar)))) { + value = (checkStr - uh); goto firstEnd; } } @@ -3668,7 +3668,7 @@ TclStringLast( int lh, ln = Tcl_GetCharLength(needle); Tcl_Obj *result; int value = -1; - Tcl_UniChar *check, *uh, *un; + Tcl_UniChar *checkStr, *uh, *un; if (ln == 0) { /* @@ -3714,14 +3714,14 @@ TclStringLast( /* Don't start the loop if there cannot be a valid answer */ goto lastEnd; } - check = uh + last + 1 - ln; - while (check >= uh) { - if ((*check == un[0]) - && (0 == memcmp(check+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) { - value = (check - uh); + checkStr = uh + last + 1 - ln; + while (checkStr >= uh) { + if ((*checkStr == un[0]) + && (0 == memcmp(checkStr+1, un+1, (ln-1)*sizeof(Tcl_UniChar)))) { + value = (checkStr - uh); goto lastEnd; } - check--; + checkStr--; } lastEnd: TclNewIntObj(result, value); |
