aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorEvan Gates <evan@gnarbox.com>2020-09-18 12:05:27 -0700
committerEvan Gates <evan@gnarbox.com>2020-09-19 09:49:48 -0700
commite938326eee9781d340ae3704a742d5e3bad95cb6 (patch)
tree014bc26df53c5a2be8812da679b25ec7618b6269 /vis.c
parent2290224c844775d446fc8aaf3a98c0149d935875 (diff)
downloadvis-e938326eee9781d340ae3704a742d5e3bad95cb6.tar.gz
vis-e938326eee9781d340ae3704a742d5e3bad95cb6.tar.xz
Add ignorecase option
Add a global ignorecase boolean option. When set add REG_ICASE to cflags when calling text_regex_compile().
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index c4e8fa1..d84622c 100644
--- a/vis.c
+++ b/vis.c
@@ -1685,7 +1685,8 @@ Regex *vis_regex(Vis *vis, const char *pattern) {
Regex *regex = text_regex_new();
if (!regex)
return NULL;
- if (text_regex_compile(regex, pattern, REG_EXTENDED|REG_NEWLINE) != 0) {
+ int cflags = REG_EXTENDED|REG_NEWLINE|(REG_ICASE*vis->ignorecase);
+ if (text_regex_compile(regex, pattern, cflags) != 0) {
text_regex_free(regex);
return NULL;
}