[hackers] [quark] Fix mime-check || FRIGN

From: <git_AT_suckless.org>
Date: Sat, 09 Aug 2014 21:41:40 +0200

commit dc82dd9705c0e51980a3cf056cfb7482f1954fbc
Author: FRIGN <dev_AT_frign.de>
Date: Sat Aug 9 21:42:31 2014 +0200

    Fix mime-check
    
    For "" to actually go through, strcmp should only check for the length
    of the extension string.

diff --git a/quark.c b/quark.c
index 9349101..f0d32eb 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -209,7 +209,9 @@ responsefile(void) {
                         if ((p = strrchr(reqbuf, '.'))) {
                                 p++;
                                 for (i = 0; i < LENGTH(servermimes); i++)
- if (!strcmp(servermimes[i].extension, p)) {
+ if (!strncmp(servermimes[i].extension, p,
+ strlen(servermimes[i].extension)))
+ {
                                                 mimetype = servermimes[i].mimetype;
                                                 break;
                                         }
Received on Sat Aug 09 2014 - 21:41:40 CEST

This archive was generated by hypermail 2.3.0 : Sat Aug 09 2014 - 21:48:08 CEST