directory: add new objects to the end of the linked list

This was the cause of the reversed ordering when loading a database
file.
This commit is contained in:
Max Kellermann 2012-02-02 09:59:31 +01:00
parent e87b7daab5
commit 535a61b5a9

View File

@ -112,7 +112,7 @@ directory_new_child(struct directory *parent, const char *name_utf8)
g_free(allocated); g_free(allocated);
db_lock(); db_lock();
list_add(&directory->siblings, &parent->children); list_add_tail(&directory->siblings, &parent->children);
db_unlock(); db_unlock();
return directory; return directory;
} }
@ -184,7 +184,7 @@ directory_add_song(struct directory *directory, struct song *song)
assert(song != NULL); assert(song != NULL);
assert(song->parent == directory); assert(song->parent == directory);
list_add(&song->siblings, &directory->songs); list_add_tail(&song->siblings, &directory->songs);
} }
void void