diff options
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -491,7 +491,12 @@ static void show_line(struct grep_opt *opt, char *bol, char *eol, int rest = eol - bol; if (opt->pre_context || opt->post_context) { - if (opt->last_shown && lno > opt->last_shown + 1) + if (opt->last_shown == 0) { + if (opt->show_hunk_mark) + fputs("--\n", stdout); + else + opt->show_hunk_mark = 1; + } else if (lno > opt->last_shown + 1) fputs("--\n", stdout); } opt->last_shown = lno; |