aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter/ChangeLog8
-rw-r--r--filter/filter-message-search.c14
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;
}