diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-16 01:17:20 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-16 01:17:20 +0200 |
commit | aea0cac331fec86fba20dba096bb0e22c0e3f977 (patch) | |
tree | b0919dc82d606ef3dc55ba25a73f6ea98b0ebaa6 | |
parent | a8d7b223e95bc40c65d6dd7838a1656a2203309b (diff) |
Output subdirectories when listing.
-rw-r--r-- | commands.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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); |