[package] uhttpd: properly match mimetype entries which cover the whole filename...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 4 Sep 2011 10:21:05 +0000 (10:21 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 4 Sep 2011 10:21:05 +0000 (10:21 +0000)
SVN-Revision: 28160

package/uhttpd/Makefile
package/uhttpd/src/uhttpd-file.c

index 93ac8cf03eaaeabf110f4082cf1813fe6ff898bd..5fa12fc8bcddf92fb5bacbecf4a4f4224b2747dc 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=25
+PKG_RELEASE:=26
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 PKG_CONFIG_DEPENDS := \
index fda86d72631031c7f1884e58590a99a0df3c0c63..816a69124ed47d1e214152aedfff5ac05a777fb5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * uhttpd - Tiny single-threaded httpd - Static file handler
  *
- *   Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
+ *   Copyright (C) 2010-2011 Jo-Philipp Wich <xm@subsignal.org>
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ static const char * uh_file_mime_lookup(const char *path)
 
                while( e >= path )
                {
-                       if( (*e == '.') && !strcasecmp(&e[1], m->extn) )
+                       if( (*e == '.' || *e == '/') && !strcasecmp(&e[1], m->extn) )
                                return m->mime;
 
                        e--;