summaryrefslogtreecommitdiff
path: root/src/koi8.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/koi8.c')
-rw-r--r--src/koi8.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/koi8.c b/src/koi8.c
index 37023c6..90a04f9 100644
--- a/src/koi8.c
+++ b/src/koi8.c
@@ -2,7 +2,7 @@
koi8.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2019 K.Kosako
+ * Copyright (c) 2002-2020 K.Kosako
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -105,12 +105,16 @@ static const unsigned short EncKOI8_CtypeTable[256] = {
static int
-koi8_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED,
+koi8_mbc_case_fold(OnigCaseFoldType flag,
const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower)
{
const UChar* p = *pp;
- *lower = ENC_KOI8_TO_LOWER_CASE(*p);
+ if (CASE_FOLD_IS_NOT_ASCII_ONLY(flag) || ONIGENC_IS_ASCII_CODE(*p))
+ *lower = ENC_KOI8_TO_LOWER_CASE(*p);
+ else
+ *lower = *p;
+
(*pp)++;
return 1;
}