diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-11-14 03:25:11 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-11-14 03:25:11 +0800 |
commit | ba34e2908d45dee6fe077e482aa91e5272172dcc (patch) | |
tree | 712aa0f0fee3db8d1eb98d3afb1d4c51898ee915 | |
parent | cd92ba2727e5bde7515dd3ea6d2b2bb034ffb431 (diff) | |
download | gsoc2013-evolution-ba34e2908d45dee6fe077e482aa91e5272172dcc.tar.gz gsoc2013-evolution-ba34e2908d45dee6fe077e482aa91e5272172dcc.tar.zst gsoc2013-evolution-ba34e2908d45dee6fe077e482aa91e5272172dcc.zip |
Neglect any leading whitespace in the header contents.
2000-11-13 Jeffrey Stedfast <fejj@helixcode.com>
* filter-message-search.c (header_matches): Neglect any leading
whitespace in the header contents.
(header_starts_with): Same.
(header_ends_with): Same.
(header_soundex): Same.
svn path=/trunk/; revision=6562
-rw-r--r-- | filter/ChangeLog | 8 | ||||
-rw-r--r-- | filter/filter-message-search.c | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 4e67a7a22f..00f4c1dec4 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,11 @@ +2000-11-13 Jeffrey Stedfast <fejj@helixcode.com> + + * filter-message-search.c (header_matches): Neglect any leading + whitespace in the header contents. + (header_starts_with): Same. + (header_ends_with): Same. + (header_soundex): Same. + 2000-11-12 Jeffrey Stedfast <fejj@helixcode.com> * filter-driver.c (filter_driver_filter_message): If there is a diff --git a/filter/filter-message-search.c b/filter/filter-message-search.c index d5b80c6485..f2b13eadd9 100644 --- a/filter/filter-message-search.c +++ b/filter/filter-message-search.c @@ -124,6 +124,9 @@ header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMe gboolean is_lowercase = TRUE; char *c; + /* remove any leading white space... */ + for ( ; *contents && isspace (*contents); contents++); + for (c = match; *c; c++) { if (isalpha (*c) && isupper (*c)) { is_lowercase = FALSE; @@ -131,6 +134,8 @@ header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMe } } + printf ("comparing: '%s' with '%s'\n", contents, match); + if (is_lowercase) { if (!g_strcasecmp (contents, match)) matched = TRUE; @@ -168,6 +173,9 @@ header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filt gboolean is_lowercase = TRUE; char *c; + /* remove any leading white space... */ + for ( ; *contents && isspace (*contents); contents++); + for (c = match; *c; c++) { if (isalpha (*c) && isupper (*c)) { is_lowercase = FALSE; @@ -212,6 +220,9 @@ header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, Filter gboolean is_lowercase = TRUE; char *c, *end; + /* remove any leading white space... */ + for ( ; *contents && isspace (*contents); contents++); + for (c = match; *c; c++) { if (isalpha (*c) && isupper (*c)) { is_lowercase = FALSE; @@ -323,6 +334,9 @@ header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMe contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); if (contents) { + /* remove any leading white space... */ + for ( ; *contents && isspace (*contents); contents++); + if (!soundexcmp (contents, match)) matched = TRUE; } |