From f7fa35fb4cc843673237fea3168eb3dedfb638f6 Mon Sep 17 00:00:00 2001 From: "K.Kosako" Date: Wed, 28 Feb 2018 16:57:35 +0900 Subject: [PATCH] refactoring --- src/regparse.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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; -- 2.40.0