aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-message-search.c
diff options
context:
space:
mode:
Diffstat (limited to 'filter/filter-message-search.c')
-rw-r--r--filter/filter-message-search.c14
1 files changed, 14 insertions, 0 deletions
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;
}