From 3a728b28df662af9ad588a9a95c94ce030a3f4dd Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 27 Nov 2023 14:20:43 -0500 Subject: Fix "-w" flag and fix optimization for skipping to match --- match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'match.c') diff --git a/match.c b/match.c index 9a784b3..d821f20 100644 --- a/match.c +++ b/match.c @@ -295,7 +295,7 @@ static pat_t *get_prerequisite(match_ctx_t *ctx, pat_t *pat) case BP_CHAIN: { auto chain = Match(p, BP_CHAIN); // If pattern is something like (|"foo"|), then use "foo" as the first thing to scan for - p = (chain->first->type == BP_WORD_BOUNDARY || chain->first->type == BP_START_OF_LINE) ? chain->second : chain->first; + p = chain->first->max_matchlen == 0 ? chain->second : chain->first; break; } case BP_MATCH: -- cgit v1.2.3