[hackers] [quark] Fix dir-check in dirent || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Wed, 28 Jun 2017 08:30:13 +0200 (CEST)

commit 1e65a4848e04660ae4d4717777ef418993da6a7e
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Wed Jun 28 08:29:31 2017 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Wed Jun 28 08:29:31 2017 +0200

    Fix dir-check in dirent
    
    We cannot do this, as it falsely added a / to a link pointing to a
    socket.

diff --git a/quark.c b/quark.c
index 3c80be1..49cef68 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -387,7 +387,7 @@ senddir(int fd, char *name, struct request *r)
                         /* entry line */
                         if (dprintf(fd, "<br />\n\t\t<a href=\"%s%s\">%s%s</a>",
                                     e[i]->d_name,
- (e[i]->d_type & DT_DIR ? "/" : ""),
+ (e[i]->d_type == DT_DIR) ? "/" : "",
                                     e[i]->d_name,
                                     filetype(e[i]->d_type)) < 0) {
                                 s = S_REQUEST_TIMEOUT;
Received on Wed Jun 28 2017 - 08:30:13 CEST

This archive was generated by hypermail 2.3.0 : Wed Jun 28 2017 - 08:36:17 CEST