From: K.Kosako Date: Thu, 4 Oct 2018 12:23:47 +0000 (+0900) Subject: expand case fold if string is a single character case X-Git-Tag: v6.9.1~18^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=77a94ce9b3956188b40a9a1ff63cbdc386d8aa7d;p=onig expand case fold if string is a single character case --- diff --git a/src/regcomp.c b/src/regcomp.c index 8e83266..31a8e35 100644 --- a/src/regcomp.c +++ b/src/regcomp.c @@ -3664,7 +3664,10 @@ expand_case_fold_string(Node* node, regex_t* reg) len = enclen(reg->enc, p); is_good = is_good_case_fold_items_for_search(reg->enc, len, n, items); - if (is_good || IS_NOT_NULL(snode)) { + if (IS_NOT_NULL(snode) || + (is_good && + /* expand single char case: ex. /(?i:a)/ */ + !(p == start && p + len >= end))) { if (IS_NULL(snode)) { if (IS_NULL(root) && IS_NOT_NULL(prev_node)) { top_root = root = onig_node_list_add(NULL_NODE, prev_node);