1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

FSP: display_entry() cleanup, and mark directories by an ending /

in lists.
This commit is contained in:
Laurent MONIN 2006-01-29 18:01:22 +01:00 committed by Laurent MONIN
parent 0c4bc5a362
commit af2cc87054

View File

@ -84,13 +84,17 @@ compare(FSP_RDENTRY *a, FSP_RDENTRY *b)
static void static void
display_entry(FSP_RDENTRY *fentry, unsigned char dircolor[]) display_entry(FSP_RDENTRY *fentry, unsigned char dircolor[])
{ {
printf("%10d\t<a href=\"%s%s\">", fentry->size, printf("%10d\t<a href=\"%s", fentry->size, fentry->name);
fentry->name, fentry->type == FSP_RDTYPE_DIR ? "/" : ""); if (fentry->type == FSP_RDTYPE_DIR) {
if (fentry->type == FSP_RDTYPE_DIR && *dircolor) printf("/\">");
printf("<font color=\"%s\"><b>", dircolor); if (*dircolor)
printf("%s", fentry->name); printf("<font color=\"%s\"><b>", dircolor);
if (fentry->type == FSP_RDTYPE_DIR && *dircolor) printf("%s/", fentry->name);
printf("</b></font>"); if (*dircolor)
printf("</b></font>");
} else {
printf("/\">%s", fentry->name);
}
puts("</a>"); puts("</a>");
} }