]> granicus.if.org Git - onig/commitdiff
change argument char from +- to X<> for (*COUNT{}) and (*TOTAL_COUNT{})
authorK.Kosako <kosako@sofnec.co.jp>
Thu, 8 Mar 2018 03:22:37 +0000 (12:22 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Thu, 8 Mar 2018 03:22:37 +0000 (12:22 +0900)
src/ascii.c
src/regexec.c
src/utf16_be.c
src/utf16_le.c

index aad2157eb018b2b0301304e2ea4792846e2df856..92aa8edd58cf595c6425964c349c5278f8fd393a 100644 (file)
@@ -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";
index 9ddcd7dcf6bb21ca9aa0691903142ac914bc8621..ac603151149fb611379247576f72e42ee5dcca89 100644 (file)
@@ -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++;
   }
 
index 3f0df0676fdd5fece52c10705b4ec1e76c0a7f6c..ebfa30cc9dea7023284eaf6d9e80f5a3e1bd5eab 100644 (file)
@@ -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";
index 3ed968f8fcaeecbdbe6576f9b13ab32c9ecc7129..bb6e3e56bf9894768318b69b4202f0faec297b50 100644 (file)
@@ -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";