From c02cc7dd9985f42e807badefe97c005d8e3534f2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 5 Mar 2024 16:59:12 +0000 Subject: Tentatively enable docroot to be indexified Signed-off-by: Laurent Bercot --- src/tipideed/tipideed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tipideed') diff --git a/src/tipideed/tipideed.c b/src/tipideed/tipideed.c index a8dd944..9ed9899 100644 --- a/src/tipideed/tipideed.c +++ b/src/tipideed/tipideed.c @@ -252,8 +252,8 @@ static inline int serve (tipidee_rql *rql, char const *docroot, char *uribuf, ti size_t pos = docrootlen + pathlen - 1 ; for (;;) { - while (fn[pos] != '/') pos-- ; - if (pos <= docrootlen) { respond_404(rql, docroot) ; return 0 ; } + while (pos && fn[pos] != '/') pos-- ; + if (!pos) { respond_404(rql, docroot) ; return 0 ; } fn[pos] = 0 ; if (stat(fn, &st) == 0) break ; switch (errno) -- cgit v1.2.3