aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/account_dialog.c10
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index de8e48f9..7c90d074 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2011-06-28
* src/foldersel.c: removed alloca() calls.
+ * src/account_dialog.c: account_open(): removed alloca() call.
2011-06-24
diff --git a/src/account_dialog.c b/src/account_dialog.c
index 49272336..22d2fb50 100644
--- a/src/account_dialog.c
+++ b/src/account_dialog.c
@@ -202,13 +202,12 @@ void account_add(void)
void account_open(PrefsAccount *ac_prefs)
{
gboolean prev_default;
- gchar *ac_name;
+ gchar *prev_name;
g_return_if_fail(ac_prefs != NULL);
prev_default = ac_prefs->is_default;
- Xstrdup_a(ac_name, ac_prefs->account_name ? ac_prefs->account_name : "",
- return);
+ prev_name = g_strdup(ac_prefs->account_name ? ac_prefs->account_name : "");
prefs_account_open(ac_prefs);
if (edit_account.window && GTK_WIDGET_VISIBLE(edit_account.window))
@@ -219,13 +218,16 @@ void account_open(PrefsAccount *ac_prefs)
if (!prev_default && ac_prefs->is_default)
account_set_as_default(ac_prefs);
- if (ac_prefs->folder && strcmp2(ac_name, ac_prefs->account_name) != 0) {
+ if (ac_prefs->folder &&
+ strcmp2(prev_name, ac_prefs->account_name) != 0) {
folder_set_name(FOLDER(ac_prefs->folder),
ac_prefs->account_name);
folderview_set_all();
folder_write_list();
}
+ g_free(prev_name);
+
account_write_config_all();
account_set_menu();
main_window_reflect_prefs_all();