From 690e285d144636ea7a15c46ab5bd4741f5c6f34a Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 2 Oct 2025 15:36:49 -0600 Subject: [PATCH] toke.c: Convert for(;;;) to simpler while() isSPACE only matches single-byte characters; no need to be concerned with UTF-8ness --- toke.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/toke.c b/toke.c index c3824345c8..21d1ceab00 100644 --- a/toke.c +++ b/toke.c @@ -701,13 +701,11 @@ S_warn_expect_operator(pTHX_ const char *const what, char *s, I32 pop_oldbufptr) } else if (PL_oldoldbufptr) { /* yyerror (via yywarn) would do this itself, so we should too */ - const char *t; - for (t = PL_oldoldbufptr; - t < PL_bufptr && isSPACE(*t); - t += UTF ? UTF8SKIP(t) : 1) - { - NOOP; + const char *t = PL_oldoldbufptr; + while (t < PL_bufptr && isSPACE(*t)) { + t++; } + /* see if we can identify the cause of the warning */ if (isIDFIRST_lazy_if_safe(t,PL_bufend,UTF)) {