Win32 fixes - Irssi now compiles with MSVC++ :)

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@851 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-11-18 15:32:59 +00:00 committed by cras
commit e3084d3ffa
4 changed files with 33 additions and 10 deletions

View file

@ -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);