From: Junio C Hamano Date: Sat, 3 Apr 2010 19:28:39 +0000 (-0700) Subject: Merge branch 'rs/threaded-grep-context' X-Git-Tag: v1.7.1-rc0~21 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=07b838f087a1535e387d5d4a1414b2b545b73265;p=git.git Merge branch 'rs/threaded-grep-context' * rs/threaded-grep-context: grep: enable threading for context line printing Conflicts: grep.c --- 07b838f087a1535e387d5d4a1414b2b545b73265 diff --cc grep.c index fdc420626,e5f06e435..543b1d537 --- a/grep.c +++ b/grep.c @@@ -563,19 -544,15 +563,18 @@@ static void show_line(struct grep_opt * const char *name, unsigned lno, char sign) { int rest = eol - bol; - char sign_str[1]; + char *line_color = NULL; - sign_str[0] = sign; if (opt->pre_context || opt->post_context) { if (opt->last_shown == 0) { - if (opt->show_hunk_mark) - opt->output(opt, "--\n", 3); - } else if (lno > opt->last_shown + 1) - opt->output(opt, "--\n", 3); + if (opt->show_hunk_mark) { + output_color(opt, "--", 2, opt->color_sep); + opt->output(opt, "\n", 1); - } else - opt->show_hunk_mark = 1; ++ } + } else if (lno > opt->last_shown + 1) { + output_color(opt, "--", 2, opt->color_sep); + opt->output(opt, "\n", 1); + } } opt->last_shown = lno;