From b57481d1dfcc9a479290f4b1849c210f951c03f2 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Mon, 16 Aug 2010 15:21:14 +0200 Subject: Use GSList with music storage. --- commands.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'commands.c') diff --git a/commands.c b/commands.c index d380c32..08b0366 100644 --- a/commands.c +++ b/commands.c @@ -20,14 +20,16 @@ static void commands_list(GSocketConnection *connection, const gchar *cmd) { GSocket *socket = g_socket_connection_get_socket(connection); - for(struct directory *d = directory->sub; d; d = d->next) { + for(GSList *node = directory->sub; node; node = g_slist_next(node)) { + struct directory *d = node->data; gchar *name = g_path_get_basename(d->path); g_socket_send(socket, name, strlen(name), NULL, NULL); g_socket_send(socket, "\n", 1, NULL, NULL); g_free(name); } - for(struct file *f = directory->files; f; f = f->next) { + for(GSList *node = directory->files; node; node = g_slist_next(node)) { + struct file *f = node->data; g_socket_send(socket, f->name, strlen(f->name), NULL, NULL); g_socket_send(socket, "\n", 1, NULL, NULL); } -- cgit v1.2.3