summaryrefslogtreecommitdiff
path: root/src/fe-common/core/hilight-text.c
diff options
context:
space:
mode:
authorisundil <isundil@knacki.info>2016-04-29 22:17:48 +0000
committerisundil <isundil@knacki.info>2016-04-29 22:17:51 +0000
commite7a18759ecb02a0b1fcbb118b9e732e604268afd (patch)
treee95735b1d93445ac96ad36d5bbd1281c4d0e455c /src/fe-common/core/hilight-text.c
parentddd54164304e8d4bc3b709dbe6d2eca7832cff81 (diff)
downloadirssi-e7a18759ecb02a0b1fcbb118b9e732e604268afd.zip
Added case-sensitive regexp matching for hilights
Diffstat (limited to 'src/fe-common/core/hilight-text.c')
-rw-r--r--src/fe-common/core/hilight-text.c7
1 files changed, 5 insertions, 2 deletions
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
}