summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-13 11:17:35 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-13 11:17:35 +0100
commitf719927edacdbc2202b3feceb351508ad7a86998 (patch)
tree3144a66ed0d6ba71e1df7caec4538eae7ea8ac05 /file.c
parent48e1a4df5a74f1c4c0e19d94977d4d5efc76a2ff (diff)
fix path lookup
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 4 insertions, 4 deletions
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;