commit 7b301d13108fbb92ccbbdd2202b1a01b137b8495
parent 761b1a1df2fe8384a75c56910a4b67a0c764942c
Author: Jacob R. Edwards <n/a>
Date: Sat, 17 Sep 2022 16:06:27 -0700
Add ICASE and NOSUB flags to regcomp() in prepsearch()
I considered adding something to the pattern, such as prefixing it
with i/pattern/, but decided to just always ignore case for now.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/aps/find.c b/aps/find.c
@@ -94,7 +94,7 @@ prepsearch(struct search *state, struct item *start, char *pattern)
reg[p - pattern] = 0;
if (!reg[0])
strcpy(reg, "^");
- if ((rcode = regcomp(&state->u.reg, reg, REG_EXTENDED))) {
+ if ((rcode = regcomp(&state->u.reg, reg, REG_EXTENDED | REG_NOSUB | REG_ICASE))) {
regerror(rcode, &state->u.reg, err, sizeof(err));
return err;
}