diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-13 11:17:35 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-13 11:17:35 +0100 |
commit | f719927edacdbc2202b3feceb351508ad7a86998 (patch) | |
tree | 3144a66ed0d6ba71e1df7caec4538eae7ea8ac05 /file.c | |
parent | 48e1a4df5a74f1c4c0e19d94977d4d5efc76a2ff (diff) |
fix path lookup
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |