forked from PsychoticNinja/irssi
Merge branch 'master' of https://github.com/irssi/irssi
This commit is contained in:
commit
712ef12542
@ -1,4 +1,4 @@
|
|||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||||
|
|
||||||
# create default-config.h
|
# create default-config.h
|
||||||
BUILT_SOURCES = default-config.h default-theme.h irssi-version.h
|
BUILT_SOURCES = default-config.h default-theme.h irssi-version.h
|
||||||
@ -27,8 +27,7 @@ pkginclude_HEADERS = irssi-config.h irssi-version.h
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
ChangeLog \
|
ChangeLog \
|
||||||
autogen.sh \
|
autogen.sh \
|
||||||
curses.m4 \
|
README.md \
|
||||||
README \
|
|
||||||
file2header.sh \
|
file2header.sh \
|
||||||
$(conf_DATA) \
|
$(conf_DATA) \
|
||||||
$(theme_DATA) \
|
$(theme_DATA) \
|
||||||
|
@ -293,10 +293,24 @@ static void ignore_remove_config(IGNORE_REC *rec)
|
|||||||
static void ignore_init_rec(IGNORE_REC *rec)
|
static void ignore_init_rec(IGNORE_REC *rec)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_REGEX_H
|
#ifdef HAVE_REGEX_H
|
||||||
|
char *errbuf;
|
||||||
|
int errcode, errbuf_len;
|
||||||
|
|
||||||
if (rec->regexp_compiled) regfree(&rec->preg);
|
if (rec->regexp_compiled) regfree(&rec->preg);
|
||||||
rec->regexp_compiled = !rec->regexp || rec->pattern == NULL ? FALSE :
|
rec->regexp_compiled = FALSE;
|
||||||
regcomp(&rec->preg, rec->pattern,
|
if (rec->regexp && rec->pattern != NULL) {
|
||||||
REG_EXTENDED|REG_ICASE|REG_NOSUB) == 0;
|
errcode = regcomp(&rec->preg, rec->pattern,
|
||||||
|
REG_EXTENDED|REG_ICASE|REG_NOSUB);
|
||||||
|
if (errcode != 0) {
|
||||||
|
errbuf_len = regerror(errcode, &rec->preg, 0, 0);
|
||||||
|
errbuf = g_malloc(errbuf_len);
|
||||||
|
regerror(errcode, &rec->preg, errbuf, errbuf_len);
|
||||||
|
g_warning("Failed to compile regexp '%s': %s", rec->pattern, errbuf);
|
||||||
|
g_free(errbuf);
|
||||||
|
} else {
|
||||||
|
rec->regexp_compiled = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,10 @@ static void ignore_print(int index, IGNORE_REC *rec)
|
|||||||
if (rec->exception) g_string_append(options, "-except ");
|
if (rec->exception) g_string_append(options, "-except ");
|
||||||
if (rec->regexp) {
|
if (rec->regexp) {
|
||||||
g_string_append(options, "-regexp ");
|
g_string_append(options, "-regexp ");
|
||||||
|
if (rec->pattern == NULL)
|
||||||
|
g_string_append(options, "[INVALID! -pattern missing] ");
|
||||||
#ifdef HAVE_REGEX_H
|
#ifdef HAVE_REGEX_H
|
||||||
if (!rec->regexp_compiled)
|
else if (!rec->regexp_compiled)
|
||||||
g_string_append(options, "[INVALID!] ");
|
g_string_append(options, "[INVALID!] ");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user