prop->expr = expr != NULL ? g_strdup(expr) : NULL;
prop->matchtype = matchtype;
+#ifndef G_OS_WIN32
prop->preg = NULL;
+#endif
prop->value = value;
prop->error = 0;
{
g_free(prop->expr);
g_free(prop->header);
+#ifndef G_OS_WIN32
if (prop->preg != NULL) {
regfree(prop->preg);
g_free(prop->preg);
}
+#endif
g_free(prop);
}
prop->expr = src->expr ? g_strdup(src->expr) : NULL;
prop->matchtype = src->matchtype;
+#ifndef G_OS_WIN32
prop->preg = NULL; /* will be re-evaluated */
+#endif
prop->value = src->value;
prop->error = src->error;
return prop;
*
*\param lines String with "\n"-separated expressions
*\param bool_and Operator
+ *\param case_sensitive If the matching is case sensitive or not
*
*\return MatcherList * New matcher list
*/
-MatcherList *matcherlist_new_from_lines(gchar *lines, gboolean bool_and)
+MatcherList *matcherlist_new_from_lines(gchar *lines, gboolean bool_and,
+ gboolean case_sensitive)
{
MatcherProp *m = NULL;
GSList *matchers = NULL;
expr = build_complete_regexp(strings);
debug_print("building matcherprop for expr '%s'\n", expr?expr:"NULL");
- m = matcherprop_new(MATCHCRITERIA_SUBJECT, NULL, MATCHTYPE_REGEXP,
- expr, 0);
+ m = matcherprop_new(MATCHCRITERIA_SUBJECT, NULL,
+ case_sensitive? MATCHTYPE_REGEXP: MATCHTYPE_REGEXPCASE,
+ expr, 0);
if (m == NULL) {
/* print error message */
debug_print("failed to allocate memory for matcherprop\n");
#else
int i = 0;
while (strings && strings[i] && *strings[i]) {
- m = matcherprop_new(MATCHCRITERIA_SUBJECT, NULL, MATCHTYPE_MATCHCASE,
- strings[i], 0);
+ m = matcherprop_new(MATCHCRITERIA_SUBJECT, NULL,
+ case_sensitive? MATCHTYPE_MATCH: MATCHTYPE_MATCHCASE,
+ strings[i], 0);
if (m == NULL) {
/* print error message */
debug_print("failed to allocate memory for matcherprop\n");
gchar buf[BUFFSIZE];
GSList *l;
- if (partinfo->type == MIMETYPE_TEXT)
+ if (!partinfo || partinfo->type == MIMETYPE_TEXT)
return FALSE;
else
outfp = procmime_get_binary_content(partinfo);
/* Don't scan non-text parts when looking in body, only
* when looking in whole message
*/
- if (partinfo && partinfo->type != MIMETYPE_TEXT &&
- (matcher->criteria == MATCHCRITERIA_NOT_BODY_PART ||
- matcher->criteria == MATCHCRITERIA_BODY_PART))
+ if (matcher->criteria == MATCHCRITERIA_NOT_BODY_PART ||
+ matcher->criteria == MATCHCRITERIA_BODY_PART)
continue;
/* if the criteria is ~body_part or ~message, ZERO lines