From f719927edacdbc2202b3feceb351508ad7a86998 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 13 Jan 2013 11:17:35 +0100 Subject: [PATCH] fix path lookup --- file.c | 8 ++++---- 1 file 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; -- 2.11.0