From ba34e2908d45dee6fe077e482aa91e5272172dcc Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 13 Nov 2000 19:25:11 +0000 Subject: Neglect any leading whitespace in the header contents. 2000-11-13 Jeffrey Stedfast * 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 --- filter/ChangeLog | 8 ++++++++ filter/filter-message-search.c | 14 ++++++++++++++ 2 files changed, 22 insertions(+) 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 + + * 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 * 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; } -- cgit