summaryrefslogtreecommitdiff
path: root/src/cp1251.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cp1251.c')
-rw-r--r--src/cp1251.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cp1251.c b/src/cp1251.c
index fa20780..36b36f6 100644
--- a/src/cp1251.c
+++ b/src/cp1251.c
@@ -2,7 +2,7 @@
cp1251.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2006-2019 Byte <byte AT mail DOT kna DOT ru>
+ * Copyright (c) 2006-2020 Byte <byte AT mail DOT kna DOT ru>
* K.Kosako
* All rights reserved.
*
@@ -105,12 +105,16 @@ static const unsigned short EncCP1251_CtypeTable[256] = {
};
static int
-cp1251_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
+cp1251_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower)
{
const UChar* p = *pp;
- *lower = ENC_CP1251_TO_LOWER_CASE(*p);
+ if (CASE_FOLD_IS_NOT_ASCII_ONLY(flag) || ONIGENC_IS_ASCII_CODE(*p))
+ *lower = ENC_CP1251_TO_LOWER_CASE(*p);
+ else
+ *lower = *p;
+
(*pp)++;
return 1;
}