evolution-mapi r74 - trunk/src/account-setup-eplugin
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-mapi r74 - trunk/src/account-setup-eplugin
- Date: Wed, 21 Jan 2009 18:27:32 +0000 (UTC)
Author: mcrha
Date: Wed Jan 21 18:27:31 2009
New Revision: 74
URL: http://svn.gnome.org/viewvc/evolution-mapi?rev=74&view=rev
Log:
2009-01-21 Milan Crha <mcrha redhat com>
** Fix for bug #567890
* exchange-mapi-account-listener.c: (check_equal),
(mapi_camel_url_equal): Do not pass NULL to a GLib function.
Modified:
trunk/src/account-setup-eplugin/ChangeLog
trunk/src/account-setup-eplugin/exchange-mapi-account-listener.c
Modified: trunk/src/account-setup-eplugin/exchange-mapi-account-listener.c
==============================================================================
--- trunk/src/account-setup-eplugin/exchange-mapi-account-listener.c (original)
+++ trunk/src/account-setup-eplugin/exchange-mapi-account-listener.c Wed Jan 21 18:27:31 2009
@@ -607,18 +607,27 @@
}
static gboolean
+check_equal (const char *a, const char *b)
+{
+ if (!a && a == b)
+ return TRUE;
+
+ return a && b && g_ascii_strcasecmp (a, b) == 0;
+}
+
+static gboolean
mapi_camel_url_equal (CamelURL *a, CamelURL *b)
{
- const char *params[] = { "profile", "domain", "ad_limit", "ad_server" };
- guint n_params = G_N_ELEMENTS (params), i;
- gboolean retval = TRUE;
+ const char *params[] = { "profile", "domain", "ad_limit", "ad_server" };
+ guint n_params = G_N_ELEMENTS (params), i;
+ gboolean retval = TRUE;
- retval &= camel_url_equal (a, b);
+ retval = camel_url_equal (a, b);
- for (i = 0; i < n_params; ++i)
- retval &= (g_ascii_strcasecmp (camel_url_get_param (a, params[i]), camel_url_get_param (b, params[i])) == 0);
+ for (i = 0; retval && i < n_params; ++i)
+ retval = retval && check_equal (camel_url_get_param (a, params[i]), camel_url_get_param (b, params[i]));
- return retval;
+ return retval;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]