From: Felix Fietkau Date: Sun, 13 Jan 2013 10:17:35 +0000 (+0100) Subject: fix path lookup X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=f719927edacdbc2202b3feceb351508ad7a86998;p=project%2Fuhttpd.git fix path lookup --- diff --git a/file.c b/file.c index b2e6ade..1238ebd 100644 --- a/file.c +++ b/file.c @@ -179,6 +179,10 @@ uh_path_lookup(struct client *cl, const char *url) if (!exists) continue; + /* test current path */ + if (stat(path_phys, &p.stat)) + continue; + snprintf(path_info, sizeof(path_info), "%s", uh_buf + i); break; } @@ -189,10 +193,6 @@ uh_path_lookup(struct client *cl, const char *url) path_phys[docroot_len] != '/')) return NULL; - /* test current path */ - if (stat(path_phys, &p.stat)) - return NULL; - /* is a regular file */ if (p.stat.st_mode & S_IFREG) { p.root = docroot;