summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-13 15:23:08 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-13 15:23:08 (GMT)
commit683756c1bdcc1745f0953b26f798154e1fdff5a1 (patch)
tree09b6a976eb8712446f41b0438c85a03a25cd7f3a /generic/tclProc.c
parent137310bc48c268ffa2c880ec847258e394e1475c (diff)
downloadtcl-683756c1bdcc1745f0953b26f798154e1fdff5a1.zip
tcl-683756c1bdcc1745f0953b26f798154e1fdff5a1.tar.gz
tcl-683756c1bdcc1745f0953b26f798154e1fdff5a1.tar.bz2
In some places, Tcl_UtfPrev()/Tcl_UtfNext() is used traversing the individual bytes of a string searching for '(', ')', '::' or other single bytes. It is overkill to use Tcl_UtfPrev/Tcl_UtfNext for that, since those characters can only appear as their ASCII byte, not as any other sequence.
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index f050d54..7be1fb7 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -511,7 +511,7 @@ TclCreateProc(
*/
argnamei = argname;
- argnamelast = Tcl_UtfPrev(argname + nameLength, argname);
+ argnamelast = (nameLength > 0) ? (argname + nameLength - 1) : argname;
while (argnamei < argnamelast) {
if (*argnamei == '(') {
if (*argnamelast == ')') { /* We have an array element. */
@@ -532,7 +532,7 @@ TclCreateProc(
"FORMALARGUMENTFORMAT", NULL);
goto procError;
}
- argnamei = Tcl_UtfNext(argnamei);
+ argnamei++;
}
if (precompiled) {