diff options
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |