From afe32dfe3c3294ff12a9c39d1294cd2db66b5ec8 Mon Sep 17 00:00:00 2001 From: Ben Winston Date: Tue, 23 Jul 2024 19:11:38 -0400 Subject: bugfix: don't match on empty text --- booki.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/booki.c b/booki.c index efec71a..8f9af6d 100644 --- a/booki.c +++ b/booki.c @@ -745,6 +745,9 @@ bool match_string(const char* pattern, const ES text) { // empty pattern matches everything if (!*pattern) return true; + // empty text matches nothing + if (text.len == 0) return false; + // get lengths int pattern_length = strlen(pattern); -- cgit v1.2.3