[evolution-data-server] Bug 777781 - Unfold header values before comparing them
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 777781 - Unfold header values before comparing them
- Date: Thu, 26 Jan 2017 16:23:32 +0000 (UTC)
commit fa4f491578363c448bc60f5a06ce68985af07d1c
Author: Milan Crha <mcrha redhat com>
Date: Thu Jan 26 17:23:30 2017 +0100
Bug 777781 - Unfold header values before comparing them
src/camel/camel-search-private.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/camel/camel-search-private.c b/src/camel/camel-search-private.c
index 8a38f0f..8b39ea2 100644
--- a/src/camel/camel-search-private.c
+++ b/src/camel/camel-search-private.c
@@ -444,9 +444,13 @@ camel_search_header_match (const gchar *value,
const guchar *ptr;
gint truth = FALSE, i;
CamelInternetAddress *cia;
- gchar *v, *vdom, *mdom;
+ gchar *v, *vdom, *mdom, *unfolded;
gunichar c;
+ unfolded = camel_header_unfold (value);
+ if (unfolded)
+ value = unfolded;
+
ptr = (const guchar *) value;
while ((c = camel_utf8_getc (&ptr)) && g_unichar_isspace (c))
value = (const gchar *) ptr;
@@ -478,8 +482,10 @@ camel_search_header_match (const gchar *value,
case CAMEL_SEARCH_TYPE_ADDRESS_ENCODED:
case CAMEL_SEARCH_TYPE_ADDRESS:
/* Possible simple case to save some work if we can. */
- if (header_match (value, match, how))
- return TRUE;
+ if (header_match (value, match, how)) {
+ truth = TRUE;
+ break;
+ }
/* Now we decode any addresses, and try
* as-is matches on name and address parts. */
@@ -498,6 +504,8 @@ camel_search_header_match (const gchar *value,
break;
}
+ g_free (unfolded);
+
return truth;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]