From: K.Kosako Date: Thu, 8 Mar 2018 03:22:37 +0000 (+0900) Subject: change argument char from +- to X<> for (*COUNT{}) and (*TOTAL_COUNT{}) X-Git-Tag: v6.8.0~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b37d781a16930ff28a3c2d503328f38d3d4f7105;p=onig change argument char from +- to X<> for (*COUNT{}) and (*TOTAL_COUNT{}) --- diff --git a/src/ascii.c b/src/ascii.c index aad2157..92aa8ed 100644 --- a/src/ascii.c +++ b/src/ascii.c @@ -51,11 +51,11 @@ init(void) name = "MAX"; BC_B(name, max, 1, &t_long); name = "COUNT"; - args[0] = ONIG_TYPE_CHAR; opts[0].c = ' '; + args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, count, 1, args, 1, opts); name = "TOTAL_COUNT"; - args[0] = ONIG_TYPE_CHAR; opts[0].c = ' '; + args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, total_count, 1, args, 1, opts); name = "CMP"; diff --git a/src/regexec.c b/src/regexec.c index 9ddcd7d..ac60315 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -5348,7 +5348,7 @@ onig_builtin_total_count(OnigCalloutArgs* args, void* user_data ARG_UNUSED) if (r != ONIG_NORMAL) return r; count_type = aval.c; - if (count_type != ' ' && count_type != '+' && count_type != '-') + if (count_type != '>' && count_type != 'X' && count_type != '<') return ONIGERR_INVALID_CALLOUT_ARG; slot = 0; @@ -5363,13 +5363,13 @@ onig_builtin_total_count(OnigCalloutArgs* args, void* user_data ARG_UNUSED) } if (args->in == ONIG_CALLOUT_IN_RETRACTION) { - if (count_type == '-') + if (count_type == '<') val.l++; - else if (count_type == '+') + else if (count_type == 'X') val.l--; } else { - if (count_type != '-') + if (count_type != '<') val.l++; } diff --git a/src/utf16_be.c b/src/utf16_be.c index 3f0df06..ebfa30c 100644 --- a/src/utf16_be.c +++ b/src/utf16_be.c @@ -52,11 +52,11 @@ init(void) name = "\000M\000A\000X\000\000"; BC_B(name, max, 1, &t_long); name = "\000C\000O\000U\000N\000T\000\000"; - args[0] = ONIG_TYPE_CHAR; opts[0].c = ' '; + args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, count, 1, args, 1, opts); name = "\000T\000O\000T\000A\000L\000_\000C\000O\000U\000N\000T\000\000"; - args[0] = ONIG_TYPE_CHAR; opts[0].c = ' '; + args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, total_count, 1, args, 1, opts); name = "\000C\000M\000P\000\000"; diff --git a/src/utf16_le.c b/src/utf16_le.c index 3ed968f..bb6e3e5 100644 --- a/src/utf16_le.c +++ b/src/utf16_le.c @@ -50,11 +50,11 @@ init(void) name = "M\000A\000X\000\000\000"; BC_B(name, max, 1, &t_long); name = "C\000O\000U\000N\000T\000\000\000"; - args[0] = ONIG_TYPE_CHAR; opts[0].c = ' '; + args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, count, 1, args, 1, opts); name = "T\000O\000T\000A\000L\000_\000C\000O\000U\000N\000T\000\000\000"; - args[0] = ONIG_TYPE_CHAR; opts[0].c = ' '; + args[0] = ONIG_TYPE_CHAR; opts[0].c = '>'; BC_B_O(name, total_count, 1, args, 1, opts); name = "C\000M\000P\000\000\000";