summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-08-16 01:17:20 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-08-16 01:17:20 +0200
commitaea0cac331fec86fba20dba096bb0e22c0e3f977 (patch)
treeb0919dc82d606ef3dc55ba25a73f6ea98b0ebaa6
parenta8d7b223e95bc40c65d6dd7838a1656a2203309b (diff)
Output subdirectories when listing.
-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);