From 3e038abcc81d9b46bc0b9eac75389e954bd63caa Mon Sep 17 00:00:00 2001 From: josuah Date: Fri, 18 Nov 2016 22:11:49 -0500 Subject: [PATCH] Fixed segfault when only header match --- buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buffer.c b/buffer.c index 9b63b94..bf9caf4 100644 --- a/buffer.c +++ b/buffer.c @@ -158,7 +158,7 @@ line_match_input(Line *line, char *input, Opt *opt) Line * matching_prev(Line *line) { - while (((line = line->prev) && !line->matches) || line->header) + while ((line = line->prev) && (!line->matches || line->header)) ; return line; } @@ -170,7 +170,7 @@ matching_prev(Line *line) Line * matching_next(Line *line) { - while (((line = line->next) && !line->matches) || line->header) + while ((line = line->next) && (!line->matches || line->header)) ; return line; } -- 2.11.4.GIT