summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--src/core/ignore.c20
-rw-r--r--src/fe-common/core/fe-ignore.c4
3 files changed, 22 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 5bb0a2d7..4f1d1112 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
# create default-config.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 = \
ChangeLog \
autogen.sh \
- curses.m4 \
- README \
+ README.md \
file2header.sh \
$(conf_DATA) \
$(theme_DATA) \
diff --git a/src/core/ignore.c b/src/core/ignore.c
index a7aa106f..eda232c7 100644
--- a/src/core/ignore.c
+++ b/src/core/ignore.c
@@ -293,10 +293,24 @@ static void ignore_remove_config(IGNORE_REC *rec)
static void ignore_init_rec(IGNORE_REC *rec)
{
#ifdef HAVE_REGEX_H
+ char *errbuf;
+ int errcode, errbuf_len;
+
if (rec->regexp_compiled) regfree(&rec->preg);
- rec->regexp_compiled = !rec->regexp || rec->pattern == NULL ? FALSE :
- regcomp(&rec->preg, rec->pattern,
- REG_EXTENDED|REG_ICASE|REG_NOSUB) == 0;
+ rec->regexp_compiled = FALSE;
+ if (rec->regexp && rec->pattern != NULL) {
+ 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
}
diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c
index 7c23ad94..6d53bf1b 100644
--- a/src/fe-common/core/fe-ignore.c
+++ b/src/fe-common/core/fe-ignore.c
@@ -56,8 +56,10 @@ static void ignore_print(int index, IGNORE_REC *rec)
if (rec->exception) g_string_append(options, "-except ");
if (rec->regexp) {
g_string_append(options, "-regexp ");
+ if (rec->pattern == NULL)
+ g_string_append(options, "[INVALID! -pattern missing] ");
#ifdef HAVE_REGEX_H
- if (!rec->regexp_compiled)
+ else if (!rec->regexp_compiled)
g_string_append(options, "[INVALID!] ");
#endif
}