diff options
| author | Ben Winston | 2024-07-23 19:11:38 -0400 |
|---|---|---|
| committer | Ben Winston | 2024-07-23 19:11:38 -0400 |
| commit | afe32dfe3c3294ff12a9c39d1294cd2db66b5ec8 (patch) | |
| tree | 8e49487cbe970559055b393bfbb3366bc57bae24 | |
| parent | 2ba9fc01bd1f1f54b50004c97d7239a469dd6f19 (diff) | |
bugfix: don't match on empty text
| -rw-r--r-- | booki.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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); |
