From e7a18759ecb02a0b1fcbb118b9e732e604268afd Mon Sep 17 00:00:00 2001 From: isundil Date: Fri, 29 Apr 2016 22:17:48 +0000 Subject: Added case-sensitive regexp matching for hilights --- src/fe-common/core/hilight-text.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 78815a42..d1c4718c 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -122,8 +122,11 @@ static void hilight_init_rec(HILIGHT_REC *rec) { #ifdef HAVE_REGEX_H if (rec->regexp_compiled) regfree(&rec->preg); - rec->regexp_compiled = !rec->regexp ? FALSE : - regcomp(&rec->preg, rec->text, REG_EXTENDED|REG_ICASE) == 0; + if (!rec->regexp) + rec->regexp_compiled = FALSE; + else + rec->regexp_compiled = regcomp(&rec->preg, rec->text, + rec->case_sensitive ? REG_EXTENDED : (REG_EXTENDED|REG_ICASE)) == 0; #endif } -- cgit v1.2.3