mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
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:
parent
14e5dc8b8e
commit
e3084d3ffa
4 changed files with 33 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue