diff src/blist.c @ 13195:c242836ff793

[gaim-migrate @ 15558] sf patch #1421206, from Sadrul Habib Chowdhury Fix a crash when renaming a group to an already existing group name (sf bug #1421118) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 09 Feb 2006 00:10:12 +0000
parents fa99be331f2f
children b53fe4fa46b6
line wrap: on
line diff
--- a/src/blist.c	Thu Feb 09 00:00:08 2006 +0000
+++ b/src/blist.c	Thu Feb 09 00:10:12 2006 +0000
@@ -994,6 +994,7 @@
 		/* Make a copy of the old group name and then delete the old group */
 		old_name = g_strdup(source->name);
 		gaim_blist_remove_group(source);
+		source = dest;
 	} else {
 		/* A simple rename */
 		GaimBlistNode *cnode, *bnode;
@@ -1007,7 +1008,6 @@
 
 		old_name = source->name;
 		source->name = g_strdup(new_name);
-
 	}
 
 	/* Save our changes */
@@ -1018,6 +1018,7 @@
 		ops->update(gaimbuddylist, (GaimBlistNode*)source);
 
 	/* Notify all PRPLs */
+	/* TODO: Is this condition needed?  Seems like it would always be TRUE */
 	if(old_name && source && strcmp(source->name, old_name)) {
 		for (accts = gaim_group_get_accounts(source); accts; accts = g_slist_remove(accts, accts->data)) {
 			GaimAccount *account = accts->data;