aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-08-01 20:07:06 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-08-01 20:07:06 +0530
commit60ff5669deca70067c50cd446b9c3a0ee99cc344 (patch)
tree4b1fc3f859a038a94bf9816fff082967d8308fa2
parenteec951a2f92d18260acef6d421ee059d0511673b (diff)
engine: skip index.html while handling EACHDO resources
-rw-r--r--src/engine.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/engine.c b/src/engine.c
index 5e91b7d..e0bb526 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -131,6 +131,14 @@ handle_eachdo(char **buffer, key_match_t *match, directive_t *directive)
trim(operands->key),
(char *) file_wrp->ptr);
+ int len = strlen(path);
+ char *comparable = &path[len - strlen("index.html")];
+ if (strcmp(comparable, "index.html") == 0) {
+ free(path);
+ free(file_wrp->ptr);
+ continue;
+ }
+
FILE *f = fopen(path, "r");
free(path);
size_t size = fsize(f);