summaryrefslogtreecommitdiffstats
path: root/src/interp.c
diff options
context:
space:
mode:
authorandmarti1424 <andmarti@gmail.com>2017-02-23 22:50:31 -0300
committerandmarti1424 <andmarti@gmail.com>2017-02-23 22:50:31 -0300
commit40fc2c46609f6508a24f01996260b01d4464bc85 (patch)
tree83954c68abcdecf70648573c79e5fc690d8d88ca /src/interp.c
parent312f00cabad22232e68a0542c54b3c4421089a41 (diff)
Added ignorecase configuration flag for string searchs - #152
Diffstat (limited to 'src/interp.c')
-rw-r--r--src/interp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interp.c b/src/interp.c
index 8e0ee30..6b40e20 100644
--- a/src/interp.c
+++ b/src/interp.c
@@ -1638,9 +1638,12 @@ void str_search(char *s, int firstrow, int firstcol, int lastrow_, int lastcol_,
regex_t preg;
int errcode;
- //if (!loading) remember(0);
+ if ( atoi(get_conf_value("ignorecase")))
+ errcode = regcomp(&preg, s, REG_EXTENDED | REG_ICASE);
+ else
+ errcode = regcomp(&preg, s, REG_EXTENDED);
- if ((errcode = regcomp(&preg, s, REG_EXTENDED))) {
+ if (errcode) {
scxfree(s);
tmp = scxmalloc((size_t)160);
regerror(errcode, &preg, tmp, sizeof(tmp));