From 7fadc82a4318d71e0635bedf9b6e686351d09e1d Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Tue, 24 Sep 2024 02:37:37 +0200 Subject: [PATCH] Only read .kong files --- Sources/kong.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/kong.c b/Sources/kong.c index 7b7ef5c..82f8ab4 100644 --- a/Sources/kong.c +++ b/Sources/kong.c @@ -831,7 +831,11 @@ int main(int argc, char **argv) { strcat(path, "/"); strcat(path, f.name); - read_file(path); + size_t length = strlen(path); + size_t dotkong_length = strlen(".kong"); + if (length > dotkong_length && strcmp(&path[length - dotkong_length], ".kong") == 0) { + read_file(path); + } f = read_next_file(&dir); }