continue;
if (prefix && *prefix && (strncmp(prefix, nntp_data->group, strlen(prefix)) != 0))
continue;
- if (Mask && !((regexec(Mask->regex, nntp_data->group, 0, NULL, 0) == 0) ^ Mask->not))
+ if (Mask && Mask->regex && !((regexec(Mask->regex, nntp_data->group, 0, NULL, 0) == 0) ^ Mask->not))
continue;
add_folder(menu, state, nntp_data->group, NULL, NULL, NULL, nntp_data);
}
{
continue;
}
- if (Mask && !((regexec(Mask->regex, de->d_name, 0, NULL, 0) == 0) ^ Mask->not))
+ if (Mask && Mask->regex && !((regexec(Mask->regex, de->d_name, 0, NULL, 0) == 0) ^ Mask->not))
continue;
mutt_file_concat_path(buffer, d, de->d_name, sizeof(buffer));
}
else
{
- if (Mask)
+ if (Mask && Mask->regex)
{
regfree(Mask->regex);
FREE(&Mask->regex);
/* apply filemask filter. This should really be done at menu setup rather
* than at scan, since it's so expensive to scan. But that's big changes
* to browser.c */
- if (Mask && !((regexec(Mask->regex, relpath, 0, NULL, 0) == 0) ^ Mask->not))
+ if (Mask && Mask->regex && !((regexec(Mask->regex, relpath, 0, NULL, 0) == 0) ^ Mask->not))
{
FREE(&mx.mbox);
return;
if (e && e->subject)
{
e->real_subj = e->subject;
- if (ReplyRegex &&
+ if (ReplyRegex && ReplyRegex->regex &&
(regexec(ReplyRegex->regex, e->subject, 1, pmatch, 0) == 0))
{
e->subject += pmatch[0].rm_eo;
struct Envelope *e = Context->hdrs[i]->env;
if (e && e->subject)
{
- e->real_subj = (ReplyRegex &&
+ e->real_subj = (ReplyRegex && ReplyRegex->regex &&
(regexec(ReplyRegex->regex, e->subject, 1, pmatch, 0))) ?
e->subject :
e->subject + pmatch[0].rm_eo;
for (; rl; rl = rl->next)
{
+ if (!rl->regex || rl->regex->regex)
+ continue;
if (regexec(rl->regex->regex, str, (size_t) 0, (regmatch_t *) 0, (int) 0) == 0)
{
mutt_debug(5, "%s matches %s\n", str, rl->regex->pattern);
memset(dest, 0, destlen);
- if (GecosMask)
+ if (GecosMask && GecosMask->regex)
{
if (regexec(GecosMask->regex, pw->pw_gecos, 1, pat_match, 0) == 0)
mutt_str_strfcpy(dest, pw->pw_gecos + pat_match[0].rm_so,
{
int rc = -1;
- if (PgpGoodSign)
+ if (PgpGoodSign && PgpGoodSign->regex)
{
char *line = NULL;
int lineno = 0;
{
int rc = -1;
- if (PgpDecryptionOkay)
+ if (PgpDecryptionOkay && PgpDecryptionOkay->regex)
{
char *line = NULL;
int lineno = 0;
}
else if (check_sig(buf, line_info, n - 1) == 0)
line_info[n].type = MT_COLOR_SIGNATURE;
- else if (QuoteRegex && regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0)
+ else if (QuoteRegex && QuoteRegex->regex && regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0)
{
- if (Smileys && (regexec(Smileys->regex, buf, 1, smatch, 0) == 0))
+ if (Smileys && Smileys->regex && (regexec(Smileys->regex, buf, 1, smatch, 0) == 0))
{
if (smatch[0].rm_so > 0)
{
c = buf[smatch[0].rm_so];
buf[smatch[0].rm_so] = 0;
- if (QuoteRegex && regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0)
+ if (regexec(QuoteRegex->regex, buf, 1, pmatch, 0) == 0)
{
if (q_classify && line_info[n].quote == NULL)
line_info[n].quote = classify_quote(quote_list, buf + pmatch[0].rm_so,
(*last)--;
goto out;
}
- if (QuoteRegex && regexec(QuoteRegex->regex, (char *) fmt, 1, pmatch, 0) == 0)
+ if (QuoteRegex && QuoteRegex->regex && regexec(QuoteRegex->regex, (char *) fmt, 1, pmatch, 0) == 0)
{
(*line_info)[n].quote =
classify_quote(quote_list, (char *) fmt + pmatch[0].rm_so,
mutt_rfc2047_decode(&e->subject);
- if (ReplyRegex && (regexec(ReplyRegex->regex, e->subject, 1, pmatch, 0) == 0))
+ if (ReplyRegex && ReplyRegex->regex && (regexec(ReplyRegex->regex, e->subject, 1, pmatch, 0) == 0))
e->real_subj = e->subject + pmatch[0].rm_eo;
else
e->real_subj = e->subject;
static int search_attach_keyword(char *filename)
{
/* Search for the regex in AttachKeyword within a file */
- if (!AttachKeyword || !QuoteRegex)
+ if (!AttachKeyword || !AttachKeyword->regex || !QuoteRegex || !QuoteRegex->regex)
return 0;
FILE *attf = mutt_file_fopen(filename, "r");