diff options
author | isundil <isundil@knacki.info> | 2016-04-29 22:17:48 +0000 |
---|---|---|
committer | isundil <isundil@knacki.info> | 2016-04-29 22:17:51 +0000 |
commit | e7a18759ecb02a0b1fcbb118b9e732e604268afd (patch) | |
tree | e95735b1d93445ac96ad36d5bbd1281c4d0e455c /src/fe-common/core/hilight-text.c | |
parent | ddd54164304e8d4bc3b709dbe6d2eca7832cff81 (diff) | |
download | irssi-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.c | 7 |
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 } |