diff --git a/ChangeLog b/ChangeLog index 6ae8ef8556..ad5232beca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-07-06 David Hampton + + * src/gnome-utils/dialog-account.c: When creating accounts from + the register, fix the name parsing logic to correctly handle the + case where the first new account will be the first child of its + parent. Fixes #345771. + 2006-07-04 Derek Atkins * src/core-utils/gnc-glib-utils.h diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c index fff37f75da..a31a6f453f 100644 --- a/src/gnome-utils/dialog-account.c +++ b/src/gnome-utils/dialog-account.c @@ -1555,10 +1555,14 @@ gnc_split_account_name (const char *in_name, Account **base_account) GList *list, *node; group = gnc_get_current_group (); - list = xaccGroupGetAccountList (group); names = g_strsplit(in_name, gnc_get_account_separator_string(), -1); for (ptr = names; *ptr; ptr++) { + /* Stop if there are no children at the current level. */ + if (group == NULL) + break; + list = xaccGroupGetAccountList (group); + /* Look for the first name in the children. */ for (node = list; node; node = g_list_next(node)) { account = node->data; @@ -1575,9 +1579,6 @@ gnc_split_account_name (const char *in_name, Account **base_account) break; group = xaccAccountGetChildren (account); - if (group == NULL) - break; - list = xaccGroupGetAccountList (group); } out_names = g_strdupv(ptr);