aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-02 09:59:31 +0100
committerMax Kellermann <max@duempel.org>2012-02-02 09:59:38 +0100
commit535a61b5a9aa3a6b0ca005acc29cbcf4bcaf5fe7 (patch)
tree29b85148ff1c89ddfbd1e9240e3dd52daedbe868 /src/directory.c
parente87b7daab56831a5b7f69a94db75625f861d7aab (diff)
downloadmpd-535a61b5a9aa3a6b0ca005acc29cbcf4bcaf5fe7.tar.gz
mpd-535a61b5a9aa3a6b0ca005acc29cbcf4bcaf5fe7.tar.xz
mpd-535a61b5a9aa3a6b0ca005acc29cbcf4bcaf5fe7.zip
directory: add new objects to the end of the linked list
This was the cause of the reversed ordering when loading a database file.
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/directory.c b/src/directory.c
index 82bacc932..d39407c0c 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -112,7 +112,7 @@ directory_new_child(struct directory *parent, const char *name_utf8)
g_free(allocated);
db_lock();
- list_add(&directory->siblings, &parent->children);
+ list_add_tail(&directory->siblings, &parent->children);
db_unlock();
return directory;
}
@@ -184,7 +184,7 @@ directory_add_song(struct directory *directory, struct song *song)
assert(song != NULL);
assert(song->parent == directory);
- list_add(&song->siblings, &directory->songs);
+ list_add_tail(&song->siblings, &directory->songs);
}
void