aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}