summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--commands.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/commands.c b/commands.c
index b11b09c..dfdce42 100644
--- a/commands.c
+++ b/commands.c
@@ -17,6 +17,14 @@ static void commands_list(GSocketConnection *connection, const gchar *cmd) {
g_assert(directory != NULL);
GSocket *socket = g_socket_connection_get_socket(connection);
+
+ for(struct directory *d = directory->sub; d; d = d->next) {
+ 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) {
g_socket_send(socket, f->name, strlen(f->name), NULL, NULL);
g_socket_send(socket, "\n", 1, NULL, NULL);