git: fix build with with no threads
[buildroot-gz.git] / package / git / 0001-grep-set-default-output-method.patch
blobade35eb021df64bc37c783e81983baa18606780b
1 From 379642bcd8d89db52feba88a651e4e56d6ac5767 Mon Sep 17 00:00:00 2001
2 From: Brandon Williams <bmwill@google.com>
3 Date: Fri, 17 Mar 2017 11:41:54 -0700
4 Subject: [PATCH] grep: set default output method
6 Signed-off-by: Brandon Williams <bmwill@google.com>
7 Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
9 ---
10 grep.c | 12 +++++++-----
11 1 file changed, 7 insertions(+), 5 deletions(-)
13 diff --git a/grep.c b/grep.c
14 index 0dbdc1d..56ef0ec 100644
15 --- a/grep.c
16 +++ b/grep.c
17 @@ -12,6 +12,11 @@ static int grep_source_is_binary(struct grep_source *gs);
19 static struct grep_opt grep_defaults;
21 +static void std_output(struct grep_opt *opt, const void *buf, size_t size)
23 + fwrite(buf, size, 1, stdout);
27 * Initialize the grep_defaults template with hardcoded defaults.
28 * We could let the compiler do this, but without C99 initializers
29 @@ -42,6 +47,7 @@ void init_grep_defaults(void)
30 color_set(opt->color_selected, "");
31 color_set(opt->color_sep, GIT_COLOR_CYAN);
32 opt->color = -1;
33 + opt->output = std_output;
36 static int parse_pattern_type_arg(const char *opt, const char *arg)
37 @@ -152,6 +158,7 @@ void grep_init(struct grep_opt *opt, const char *prefix)
38 opt->pathname = def->pathname;
39 opt->regflags = def->regflags;
40 opt->relative = def->relative;
41 + opt->output = def->output;
43 color_set(opt->color_context, def->color_context);
44 color_set(opt->color_filename, def->color_filename);
45 @@ -1379,11 +1386,6 @@ static int look_ahead(struct grep_opt *opt,
46 return 0;
49 -static void std_output(struct grep_opt *opt, const void *buf, size_t size)
51 - fwrite(buf, size, 1, stdout);
54 static int fill_textconv_grep(struct userdiff_driver *driver,
55 struct grep_source *gs)
57 --
58 2.6.2