diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2024-03-05 16:59:12 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2024-03-05 16:59:12 +0000 |
commit | c02cc7dd9985f42e807badefe97c005d8e3534f2 (patch) | |
tree | 4478813593cad80ebcf534feb99aeb37d88f659b | |
parent | 228d717d82d3cacc744d756d02401023682a52b6 (diff) | |
download | tipidee-c02cc7dd9985f42e807badefe97c005d8e3534f2.tar.gz tipidee-c02cc7dd9985f42e807badefe97c005d8e3534f2.tar.xz tipidee-c02cc7dd9985f42e807badefe97c005d8e3534f2.zip |
Tentatively enable docroot to be indexified
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | src/tipideed/tipideed.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) |