aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-05-22 05:45:58 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-05-22 05:45:58 +0800
commit47ac3261fff7588ea4cda15cdfdf24366a4f5bf8 (patch)
treee32c2ca8cb5548183be05ea98ef11f785510e84e
parentbec22b99bb0c5afa61934c09b2bd633775a19c7e (diff)
downloadgsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.tar
gsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.tar.gz
gsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.tar.bz2
gsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.tar.lz
gsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.tar.xz
gsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.tar.zst
gsoc2013-evolution-47ac3261fff7588ea4cda15cdfdf24366a4f5bf8.zip
Use a new macro, STR_EQUAL, to tell if the 2 values are equal or not
2002-05-21 Jeffrey Stedfast <fejj@ximian.com> * mail-composer-prefs.c (spell_save_values): Use a new macro, STR_EQUAL, to tell if the 2 values are equal or not rather than using strcmp since one or both strings could be NULL. svn path=/trunk/; revision=16971
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-composer-prefs.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 1302947497..ed4c07da42 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2002-05-21 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-composer-prefs.c (spell_save_values): Use a new macro,
+ STR_EQUAL, to tell if the 2 values are equal or not rather than
+ using strcmp since one or both strings could be NULL.
+
2002-05-21 Not Zed <NotZed@Ximian.com>
* folder-browser.c (folder_browser_config_search): Split the
diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c
index c196d4635e..15f87826c6 100644
--- a/mail/mail-composer-prefs.c
+++ b/mail/mail-composer-prefs.c
@@ -623,6 +623,8 @@ spell_load_values (MailComposerPrefs *prefs)
#define SET(t,x,prop) \
gconf_client_set_ ## t (prefs->gconf, GNOME_SPELL_GCONF_DIR x, prop, NULL);
+#define STR_EQUAL(str1, str2) ((str1 == NULL && str2 == NULL) || (str1 && str2 && !strcmp (str1, str2)))
+
static void
spell_save_values (MailComposerPrefs *prefs, gboolean force)
{
@@ -631,7 +633,7 @@ spell_save_values (MailComposerPrefs *prefs, gboolean force)
SET (int, "/spell_error_color_green", prefs->spell_error_color.green);
SET (int, "/spell_error_color_blue", prefs->spell_error_color.blue);
}
- if (force || strcmp (prefs->language_str, prefs->language_str_orig)) {
+ if (force || !STR_EQUAL (prefs->language_str, prefs->language_str_orig)) {
SET (string, "/language", prefs->language_str);
}