]> granicus.if.org Git - onig/commitdiff
fix invalid error output for zero-backref \k'0'
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 23 Jun 2017 01:55:36 +0000 (10:55 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Fri, 23 Jun 2017 01:55:36 +0000 (10:55 +0900)
src/regparse.c

index 1d7c78346ee1c34097f50d9b096bb562ab7cea1c..fc34dd72f4d9f3e1863cff579059b9b8221e0218 100644 (file)
@@ -2532,8 +2532,9 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
     }
 
   err:
-    r = ONIGERR_INVALID_GROUP_NAME;
     name_end = end;
+  err2:
+    r = ONIGERR_INVALID_GROUP_NAME;
   }
 
  end:
@@ -2541,7 +2542,7 @@ fetch_name_with_level(OnigCodePoint start_code, UChar** src, UChar* end,
     if (is_num != 0) {
       *rback_num = onig_scan_unsigned_number(&pnum_head, name_end, enc);
       if (*rback_num < 0) return ONIGERR_TOO_BIG_NUMBER;
-      else if (*rback_num == 0) goto err;
+      else if (*rback_num == 0) goto err2;
 
       *rback_num *= sign;
     }