From dc82dd9705c0e51980a3cf056cfb7482f1954fbc Mon Sep 17 00:00:00 2001 From: FRIGN Date: Sat, 9 Aug 2014 21:42:31 +0200 Subject: [PATCH] Fix mime-check For "" to actually go through, strcmp should only check for the length of the extension string. --- quark.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quark.c b/quark.c index 9349101..f0d32eb 100644 --- a/quark.c +++ b/quark.c @@ -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; }