]> granicus.if.org Git - onig/commitdiff
support USE_RFC3629_RANGE disabled case
authorK.Kosako <kosako@sofnec.co.jp>
Fri, 22 Feb 2019 07:59:44 +0000 (16:59 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Thu, 28 Feb 2019 05:28:18 +0000 (14:28 +0900)
src/utf8.c

index 172d4b8636e394d0043a5620e713cc6cee2d8a6a..70c150367d7533b5da2ad00237ff34f8aa951070 100644 (file)
@@ -60,7 +60,11 @@ static const int EncLen_UTF8[] = {
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+#ifdef USE_RFC3629_RANGE
   4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+#else
+  4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
+#endif
 };
 
 static int
@@ -287,7 +291,11 @@ get_case_fold_codes_by_str(OnigCaseFoldType flag,
 OnigEncodingType OnigEncodingUTF8 = {
   mbc_enc_len,
   "UTF-8",     /* name */
+#ifdef USE_RFC3629_RANGE
   4,           /* max enc length */
+#else
+  6,
+#endif
   1,           /* min enc length */
   onigenc_is_mbc_newline_0x0a,
   mbc_to_code,