From 750f8381ce68d2c2e7b600bfac2ecc6862af2e00 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 27 Jun 2017 22:34:37 +0200 Subject: [PATCH] in the directory listing add / as suffix to save a redirect check --- quark.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quark.c b/quark.c index 3358fff..578a591 100644 --- a/quark.c +++ b/quark.c @@ -381,8 +381,11 @@ senddir(int fd, char *name, struct request *r) } /* entry line */ - if (dprintf(fd, "
\n\t\t%s%s", - e[i]->d_name, e[i]->d_name, filetype(e[i]->d_type)) < 0) { + if (dprintf(fd, "
\n\t\t%s%s", + e[i]->d_name, + e[i]->d_type & DT_DIR ? "/" : "", + e[i]->d_name, + filetype(e[i]->d_type)) < 0) { s = S_REQUEST_TIMEOUT; goto cleanup; }