]> granicus.if.org Git - onig/commitdiff
refactoring
authorK.Kosako <kosako@sofnec.co.jp>
Wed, 28 Feb 2018 07:57:35 +0000 (16:57 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Wed, 28 Feb 2018 07:57:35 +0000 (16:57 +0900)
src/regparse.c

index c9697e93de8ed581f9774f22cdbf5d580166dfdb..829c2a45f61827130d8d4ed4fda7c131e34e4ee5 100644 (file)
@@ -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;