diff options
| -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); | 
