summaryrefslogtreecommitdiff
path: root/commands.c
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-08-16 15:21:14 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-08-16 15:21:14 +0200
commitb57481d1dfcc9a479290f4b1849c210f951c03f2 (patch)
treeedfee4aec104467fde4805b67ead08ee96583ada /commands.c
parent6a328201c7f18a693b6ec8da149a0704429a436a (diff)
Use GSList with music storage.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c6
1 files changed, 4 insertions, 2 deletions
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);
}