evolution-data-server r9970 - branches/gnome-2-24/camel/providers/groupwise
- From: psankar svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9970 - branches/gnome-2-24/camel/providers/groupwise
- Date: Tue, 27 Jan 2009 08:42:34 +0000 (UTC)
Author: psankar
Date: Tue Jan 27 08:42:34 2009
New Revision: 9970
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9970&view=rev
Log:
2009-01-27 Sankar P <psankar novell com>
** Fix for bnc bug #464758
* camel-groupwise-folder.c (update_junk_list):
g_strsplit_set will add a dummy string if one of the
delimiters is the first character in the source string.
Fix a crash.
Modified:
branches/gnome-2-24/camel/providers/groupwise/ChangeLog
branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c
Modified: branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c
==============================================================================
--- branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c (original)
+++ branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c Tue Jan 27 08:42:34 2009
@@ -526,6 +526,7 @@
update_junk_list (CamelStore *store, CamelMessageInfo *info, int flag)
{
gchar **email = NULL, *from = NULL;
+ int index = 0;
CamelGroupwiseStore *gw_store= CAMEL_GROUPWISE_STORE(store);
CamelGroupwiseStorePrivate *priv = gw_store->priv;
EGwConnection *cnc = cnc_lookup (priv);
@@ -535,18 +536,25 @@
email = g_strsplit_set (from, "<>", -1);
- if (!email || !email[1])
+ if (from [0] == '<') {
+ /* g_strsplit_set will add a dummy empty string as the first string if the first character in the
+ original string is one of the delimiters that you want to suppress.
+ Refer to g_strsplit_set documentation */
+ index = 1;
+ }
+
+ if (!email || !email[index])
goto error;
if (flag == ADD_JUNK_ENTRY)
- e_gw_connection_create_junk_entry (cnc, email[1], "email", "junk");
+ e_gw_connection_create_junk_entry (cnc, email[index], "email", "junk");
else if (flag == REMOVE_JUNK_ENTRY) {
GList *list = NULL;
EGwJunkEntry *entry;
if (e_gw_connection_get_junk_entries (cnc, &list)== E_GW_CONNECTION_STATUS_OK){
while (list) {
entry = list->data;
- if (!g_ascii_strcasecmp (entry->match, email[1])) {
+ if (!g_ascii_strcasecmp (entry->match, email[index])) {
e_gw_connection_remove_junk_entry (cnc, entry->id);
}
list = list->next;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]