diff options
| author | 2024-05-15 13:27:23 +0200 | |
|---|---|---|
| committer | 2024-05-15 13:27:23 +0200 | |
| commit | ff8d49a8991977e07cf6bb50156b2ffda08d0c0e (patch) | |
| tree | 6de74de6401df99d2071db04a42124ce441b27a3 /data.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-ff8d49a8991977e07cf6bb50156b2ffda08d0c0e.tar.gz penes-snac2-ff8d49a8991977e07cf6bb50156b2ffda08d0c0e.tar.xz penes-snac2-ff8d49a8991977e07cf6bb50156b2ffda08d0c0e.zip | |
Use xs_regex_match() where applicable.
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 14 |
1 files changed, 4 insertions, 10 deletions
| @@ -2293,13 +2293,9 @@ int content_check(const char *file, const xs_dict *msg) | |||
| 2293 | while (!r && !feof(f)) { | 2293 | while (!r && !feof(f)) { |
| 2294 | xs *rx = xs_strip_i(xs_readline(f)); | 2294 | xs *rx = xs_strip_i(xs_readline(f)); |
| 2295 | 2295 | ||
| 2296 | if (*rx) { | 2296 | if (*rx && xs_regex_match(c, rx)) { |
| 2297 | xs *l = xs_regex_select_n(c, rx, 1); | 2297 | srv_debug(1, xs_fmt("content_check: match for '%s'", rx)); |
| 2298 | 2298 | r = 1; | |
| 2299 | if (xs_list_len(l)) { | ||
| 2300 | srv_debug(1, xs_fmt("content_check: match for '%s'", rx)); | ||
| 2301 | r = 1; | ||
| 2302 | } | ||
| 2303 | } | 2299 | } |
| 2304 | } | 2300 | } |
| 2305 | 2301 | ||
| @@ -2576,9 +2572,7 @@ xs_list *content_search(snac *user, const char *regex, | |||
| 2576 | c = xs_tolower_i(c); | 2572 | c = xs_tolower_i(c); |
| 2577 | 2573 | ||
| 2578 | /* apply regex */ | 2574 | /* apply regex */ |
| 2579 | xs *l = xs_regex_select_n(c, i_regex, 1); | 2575 | if (xs_regex_match(c, i_regex)) { |
| 2580 | |||
| 2581 | if (xs_list_len(l)) { | ||
| 2582 | if (xs_set_add(&seen, md5) == 1) | 2576 | if (xs_set_add(&seen, md5) == 1) |
| 2583 | show--; | 2577 | show--; |
| 2584 | } | 2578 | } |