aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r--camel/camel-mime-utils.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index ed6589819f..1d873007f6 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -3056,11 +3056,21 @@ header_raw_check_mailing_list(struct _header_raw **list)
const char *v;
regex_t pattern;
regmatch_t match[2];
- int i;
-
- for (i=0;i<sizeof(mail_list_magic)/sizeof(mail_list_magic[0]);i++) {
- if (regcomp(&pattern, mail_list_magic[i].pattern, REG_EXTENDED|REG_ICASE) == -1) {
- g_warning("Internal error, compiling regex failed: %s: %s", mail_list_magic[i].pattern, strerror(errno));
+ int i, errcode;
+
+ for (i = 0; i < sizeof (mail_list_magic) / sizeof (mail_list_magic[0]); i++) {
+ if ((errcode = regcomp (&pattern, mail_list_magic[i].pattern, REG_EXTENDED|REG_ICASE)) != 0) {
+ char *errstr;
+ size_t len;
+
+ len = regerror (errcode, pattern, NULL, 0);
+ errstr = g_malloc0 (len + 1);
+ regerror (errcode, pattern, errstr, len);
+
+ g_warning ("Internal error, compiling regex failed: %s: %s",
+ mail_list_magic[i].pattern, errstr);
+ g_free (errstr);
+
continue;
}