From: K.Kosako Date: Wed, 28 Feb 2018 07:57:35 +0000 (+0900) Subject: refactoring X-Git-Tag: v6.8.0~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f7fa35fb4cc843673237fea3168eb3dedfb638f6;p=onig refactoring --- diff --git a/src/regparse.c b/src/regparse.c index c9697e9..829c2a4 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -6670,18 +6670,16 @@ parse_callout_of_name(Node** np, int cterm, UChar** src, UChar* end, ScanEnv* en node = 0; name_start = p; - while (! PEND) { + while (1) { + if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; name_end = p; PFETCH_S(c); if (c == cterm || c == '[' || c == '{') break; - else if (c > 255) - return ONIGERR_INVALID_CALLOUT_NAME; - else { - if (! IS_ALLOWED_CODE_IN_CALLOUT_NAME(c)) - return ONIGERR_INVALID_CALLOUT_NAME; - } } + if (! is_allowed_callout_name(enc, name_start, name_end)) + return ONIGERR_INVALID_CALLOUT_NAME; + if (c == '[') { if (PEND) return ONIGERR_END_PATTERN_IN_GROUP; tag_start = p;