From af2cc87054a14cbff59e183163418334a4915f66 Mon Sep 17 00:00:00 2001 From: Laurent MONIN Date: Sun, 29 Jan 2006 18:01:22 +0100 Subject: [PATCH] FSP: display_entry() cleanup, and mark directories by an ending / in lists. --- src/protocol/fsp/fsp.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/protocol/fsp/fsp.c b/src/protocol/fsp/fsp.c index b887ebbf7..d4ca3419b 100644 --- a/src/protocol/fsp/fsp.c +++ b/src/protocol/fsp/fsp.c @@ -84,13 +84,17 @@ compare(FSP_RDENTRY *a, FSP_RDENTRY *b) static void display_entry(FSP_RDENTRY *fentry, unsigned char dircolor[]) { - printf("%10d\t", fentry->size, - fentry->name, fentry->type == FSP_RDTYPE_DIR ? "/" : ""); - if (fentry->type == FSP_RDTYPE_DIR && *dircolor) - printf("", dircolor); - printf("%s", fentry->name); - if (fentry->type == FSP_RDTYPE_DIR && *dircolor) - printf(""); + printf("%10d\tsize, fentry->name); + if (fentry->type == FSP_RDTYPE_DIR) { + printf("/\">"); + if (*dircolor) + printf("", dircolor); + printf("%s/", fentry->name); + if (*dircolor) + printf(""); + } else { + printf("/\">%s", fentry->name); + } puts(""); }