From edc806507cb3db0790b27cb76c47050b57028c4b Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Tue, 22 May 2001 14:29:27 +0000 Subject: [PATCH] Fixed extra -- lines (noted by Christophe Boyanique). --- findutils/grep.c | 3 ++- grep.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/findutils/grep.c b/findutils/grep.c index 061462ebc..07646e02a 100644 --- a/findutils/grep.c +++ b/findutils/grep.c @@ -60,7 +60,8 @@ static void print_line(const char *line, int linenum, char decoration) { #ifdef BB_FEATURE_GREP_CONTEXT /* possibly print the little '--' seperator */ - if (last_line_printed && last_line_printed < linenum - 1) { + if ((lines_before || lines_after) && last_line_printed && + last_line_printed < linenum - 1) { puts("--"); } last_line_printed = linenum; diff --git a/grep.c b/grep.c index 061462ebc..07646e02a 100644 --- a/grep.c +++ b/grep.c @@ -60,7 +60,8 @@ static void print_line(const char *line, int linenum, char decoration) { #ifdef BB_FEATURE_GREP_CONTEXT /* possibly print the little '--' seperator */ - if (last_line_printed && last_line_printed < linenum - 1) { + if ((lines_before || lines_after) && last_line_printed && + last_line_printed < linenum - 1) { puts("--"); } last_line_printed = linenum; -- 2.25.1