diff options
author | default <nobody@localhost> | 2024-05-15 06:07:33 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-05-15 06:07:33 +0200 |
commit | 2ed0a08f9fbaac8adbf1d84aa149b9f7959a965b (patch) | |
tree | 8aa704a87816e82c9f27430d2dd3570d3cc3e6b1 | |
parent | 34311714ce725da9fae9fea3b29a4988977c79bd (diff) |
Convert the regex to lowercase in content_search().
Is this a good idea?
-rw-r--r-- | data.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2498,6 +2498,8 @@ xs_list *content_search(snac *user, const char *regex, if (regex == NULL || *regex == '\0') return xs_list_new(); + xs *i_regex = xs_tolower_i(xs_dup(regex)); + xs_set seen; xs_set_init(&seen); @@ -2574,7 +2576,7 @@ xs_list *content_search(snac *user, const char *regex, c = xs_tolower_i(c); /* apply regex */ - xs *l = xs_regex_select_n(c, regex, 1); + xs *l = xs_regex_select_n(c, i_regex, 1); if (xs_list_len(l)) { if (xs_set_add(&seen, md5) == 1) |