aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-08-25 13:13:47 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-08-25 13:13:47 -0700
commitd7e18968bb92b853ab8eb691e89196e5e2e6f5db (patch)
tree635cb41b69fa9a63bc20f4ff9901015531cf8637
parent5eda0d4b881e252937e7ff44fa9876418e7684bb (diff)
Bugfix for | not working at start of file
-rw-r--r--match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.c b/match.c
index 5411c4a..ed26a62 100644
--- a/match.c
+++ b/match.c
@@ -228,7 +228,7 @@ static match_t *match(def_t *defs, file_t *f, const char *str, pat_t *pat, bool
return (str == f->end || *str == '\n') ? new_match(defs, pat, str, str, NULL) : NULL;
}
case BP_WORD_BOUNDARY: {
- return (isidcontinue(f, str) != isidcontinue(f, prev_char(f, str))) ? new_match(defs, pat, str, str, NULL) : NULL;
+ return (str == f->start || isidcontinue(f, str) != isidcontinue(f, prev_char(f, str))) ? new_match(defs, pat, str, str, NULL) : NULL;
}
case BP_STRING: {
if (&str[pat->min_matchlen] > f->end) return NULL;