aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-autofilter.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-12-11 04:09:37 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-12-11 04:09:37 +0800
commit63ce54907cd9f30f046e90be07ead0346ffe7154 (patch)
treeb7f6499cab389ca0e9eeed9b1d47a7046b77bfad /mail/mail-autofilter.c
parent4996c3207568837e3d56fab16fb29719d3542d85 (diff)
downloadgsoc2013-evolution-63ce54907cd9f30f046e90be07ead0346ffe7154.tar.gz
gsoc2013-evolution-63ce54907cd9f30f046e90be07ead0346ffe7154.tar.zst
gsoc2013-evolution-63ce54907cd9f30f046e90be07ead0346ffe7154.zip
Make sure that the message subject is non-NULL beforetrying to base a
2001-12-04 Jeffrey Stedfast <fejj@ximian.com> * mail-autofilter.c (rule_from_message): Make sure that the message subject is non-NULL beforetrying to base a vfolder rule off it. Fixes bug #16284. 2001-12-07 Jeffrey Stedfast <fejj@ximian.com> * mail-accounts.c (construct): Connect to the dialog's "destroy" event and close any druids/editors that may be open when that signal is caught. Fixes bug #16501. * mail-vfolder.c (vfolder_edit): Set the window title to "Virtual Folders". Fixes bug #16695. svn path=/trunk/; revision=14966
Diffstat (limited to 'mail/mail-autofilter.c')
-rw-r--r--mail/mail-autofilter.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index eba956e1f1..832d5827c0 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -101,6 +101,7 @@ strip_re (const char *subject)
} else
break;
}
+
return (char *) s;
}
@@ -127,7 +128,7 @@ rule_add_subject (RuleContext *context, FilterRule *rule, const char *text)
{
FilterPart *part;
FilterElement *element;
-
+
/* dont match on empty strings ever */
if (*text == 0)
return;
@@ -208,11 +209,12 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg
rule->grouping = FILTER_GROUP_ANY;
if (flags & AUTO_SUBJECT) {
+ const char *subject = msg->subject ? msg->subject : "";
char *namestr;
- rule_match_subject (context, rule, msg->subject);
+ rule_match_subject (context, rule, subject);
- namestr = g_strdup_printf (U_("Subject is %s"), strip_re (msg->subject));
+ namestr = g_strdup_printf (U_("Subject is %s"), strip_re (subject));
filter_rule_set_name (rule, namestr);
g_free (namestr);
}