summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/grep.c b/grep.c
index 6ee80f7fd9..4bca759b67 100644
--- a/grep.c
+++ b/grep.c
@@ -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;