aboutsummaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-07-17 16:47:05 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-07-17 16:47:05 -0700
commitdebd5d886c010ccf8f556517b448813cb510d114 (patch)
tree3593ba6fb85f4e3641776128882592c6a2c38c73 /match.c
parent9f2d9d86de51d6943f5f4a416d81d1cdfc2e09b9 (diff)
Simplification
Diffstat (limited to 'match.c')
-rw-r--r--match.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/match.c b/match.c
index ec252bb..240e2fa 100644
--- a/match.c
+++ b/match.c
@@ -116,10 +116,8 @@ match_t *next_match(def_t *defs, file_t *f, match_t *prev, pat_t *pat, pat_t *sk
char *found = (ignorecase ? strcasestr : strstr)(str, tmp);
if (found)
str = found;
- else if (&str[strlen(str)] == f->end)
- str = f->end+1;
else
- str = &str[strlen(str)];
+ str += strlen(str); // Use += strlen here instead of f->end to handle files with NULL bytes
free(tmp);
}