Skip to content

Commit 6f05113

Browse files
committed
pp_ctl.c: Avoid UTF8SKIPs
This value is now returned from the isID(FIRST|CONT)_utf8_safe macros. Use it instead of re-deriving it.
1 parent b829c69 commit 6f05113

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

pp_ctl.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5192,11 +5192,17 @@ S_require_file(pTHX_ SV *sv)
51925192
S_parse_ident */
51935193
c = name;
51945194
while (c < e) {
5195-
if (utf8 && isIDFIRST_utf8_safe(c, e)) {
5196-
c += UTF8SKIP(c);
5197-
while (c < e && isIDCONT_utf8_safe(
5198-
(const U8*) c, (const U8*) e))
5199-
c += UTF8SKIP(c);
5195+
Size_t advance;
5196+
5197+
if (utf8 && (advance = isIDFIRST_utf8_safe(c, e)))
5198+
{
5199+
c += advance;
5200+
while ( c < e
5201+
&& (advance = isIDCONT_utf8_safe(
5202+
(const U8*) c, (const U8*) e)))
5203+
{
5204+
c += advance;
5205+
}
52005206
}
52015207
else if (isWORDCHAR_A(*c)) {
52025208
while (c < e && isWORDCHAR_A(*c))

0 commit comments

Comments
 (0)