diff options
Diffstat (limited to 'src/core/ignore.c')
-rw-r--r-- | src/core/ignore.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/ignore.c b/src/core/ignore.c index 67ff0504..16005111 100644 --- a/src/core/ignore.c +++ b/src/core/ignore.c @@ -117,10 +117,13 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host, if (patt_len <= best_patt) continue; } +#ifdef HAVE_REGEX_H if (rec->regexp) { ok = !rec->regexp_compiled ? FALSE : regexec(&rec->preg, text, 0, NULL, 0) == 0; - } else { + } else +#endif + { ok = rec->fullword ? stristr_full(text, rec->pattern) != NULL : stristr(text, rec->pattern) != NULL; @@ -257,10 +260,11 @@ static void ignore_remove_config(IGNORE_REC *rec) void ignore_add_rec(IGNORE_REC *rec) { +#ifdef HAVE_REGEX_H rec->regexp_compiled = !rec->regexp || rec->pattern == NULL ? FALSE : regcomp(&rec->preg, rec->pattern, REG_EXTENDED|REG_ICASE|REG_NOSUB) == 0; - +#endif ignores = g_slist_append(ignores, rec); ignore_set_config(rec); @@ -272,7 +276,9 @@ static void ignore_destroy(IGNORE_REC *rec) ignores = g_slist_remove(ignores, rec); signal_emit("ignore destroyed", 1, rec); +#ifdef HAVE_REGEX_H if (rec->regexp_compiled) regfree(&rec->preg); +#endif if (rec->time_tag > 0) g_source_remove(rec->time_tag); if (rec->channels != NULL) g_strfreev(rec->channels); g_free_not_null(rec->mask); |