diff --git a/src/protocol/fsp/fsp.c b/src/protocol/fsp/fsp.c index 4f7663b23..97700dcbb 100644 --- a/src/protocol/fsp/fsp.c +++ b/src/protocol/fsp/fsp.c @@ -113,14 +113,13 @@ sort_and_display_entries(FSP_DIR *dir) (int (*)(const void *, const void *)) compare); for (i = 0; i < size; i++) { - printf("%10d\t", table[i].size, table[i].name); - if (table[i].type == FSP_RDTYPE_DIR && *dircolor) { + printf("%10d\t", table[i].size, table[i].name, + table[i].type == FSP_RDTYPE_DIR ? "/" : ""); + if (table[i].type == FSP_RDTYPE_DIR && *dircolor) printf("", dircolor); - } printf("%s", table[i].name); - if (table[i].type == FSP_RDTYPE_DIR && *dircolor) { + if (table[i].type == FSP_RDTYPE_DIR && *dircolor) printf(""); - } puts(""); } } @@ -160,14 +159,13 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri) while (!fsp_readdir_native(dir, &fentry, &fresult)) { if (!fresult) break; - printf("%10d\t", fentry.size, fentry.name); - if (fentry.type == FSP_RDTYPE_DIR && *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) { + if (fentry.type == FSP_RDTYPE_DIR && *dircolor) printf(""); - } puts(""); } fsp_closedir(dir);