aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-filter-search.c
diff options
context:
space:
mode:
author3 <NotZed@Ximian.com>2001-10-04 06:17:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-04 06:17:10 +0800
commit1ecc7068f5ccec30e1e99fc7193c26993496797a (patch)
treed4d1ed00db8f2be8dc4a28d2a79706dddacc9813 /camel/camel-filter-search.c
parent628b33f28c29f843232471e79347c10af5a9c413 (diff)
downloadgsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.tar
gsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.tar.gz
gsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.tar.bz2
gsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.tar.lz
gsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.tar.xz
gsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.tar.zst
gsoc2013-evolution-1ecc7068f5ccec30e1e99fc7193c26993496797a.zip
Added MATCH_NEWLINE flag, -> REG_NEWLINE.
2001-10-03 <NotZed@Ximian.com> * camel-search-private.c (camel_search_build_match_regex): Added MATCH_NEWLINE flag, -> REG_NEWLINE. * camel-lock-helper.c: Include <string.h> to kill some warnings. * camel-filter-search.c (get_full_header): Put \n's between each line we generate. (header_full_regex): Dont drop the first argument to the command -> empty matches! (header_full_regex): Set match_newline for building regex. (body_regex): And here too. These all fix #9877. svn path=/trunk/; revision=13392
Diffstat (limited to 'camel/camel-filter-search.c')
-rw-r--r--camel/camel-filter-search.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index 49ece8704a..45aec201e5 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -206,9 +206,7 @@ header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMess
if (argc > 1 && argv[0]->type == ESEXP_RES_STRING
&& (contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), argv[0]->value.string))
- && camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_REGEX |
- CAMEL_SEARCH_MATCH_ICASE, argc-1, argv+1,
- fms->ex) == 0) {
+ && camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE, argc-1, argv+1, fms->ex) == 0) {
r->value.bool = regexec (&pattern, contents, 0, NULL, 0) == 0;
regfree (&pattern);
} else
@@ -233,6 +231,7 @@ get_full_header (CamelMimeMessage *message)
else
g_string_append (str, ": ");
g_string_append (str, h->value);
+ g_string_append_c(str, '\n');
}
}
@@ -249,8 +248,8 @@ header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filte
regex_t pattern;
char *contents;
- if (camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_REGEX |
- CAMEL_SEARCH_MATCH_ICASE, argc-1, argv+1, fms->ex) == 0) {
+ if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_NEWLINE,
+ argc, argv, fms->ex) == 0) {
contents = get_full_header (fms->message);
r->value.bool = regexec (&pattern, contents, 0, NULL, 0) == 0;
g_free (contents);
@@ -297,8 +296,8 @@ body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessag
ESExpResult *r = e_sexp_result_new(f, ESEXP_RES_BOOL);
regex_t pattern;
- if (camel_search_build_match_regex (&pattern, CAMEL_SEARCH_MATCH_ICASE |
- CAMEL_SEARCH_MATCH_REGEX, argc, argv, fms->ex) == 0) {
+ if (camel_search_build_match_regex(&pattern, CAMEL_SEARCH_MATCH_ICASE|CAMEL_SEARCH_MATCH_REGEX|CAMEL_SEARCH_MATCH_NEWLINE,
+ argc, argv, fms->ex) == 0) {
r->value.bool = camel_search_message_body_contains ((CamelDataWrapper *)fms->message, &pattern);
regfree (&pattern);
} else