X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=grep.c;h=f67d6716ea5f42c3384a7a4cb2eb973b02785fba;hb=2c47789d817aaf745a5ce5d5f79619c634cc8566;hp=fcc676230282e4c5bda4f9f97c5ae65c1a6beb30;hpb=3ed02de2f46105cbc45fcc8f3287513f470eb4a3;p=git.git diff --git a/grep.c b/grep.c index fcc676230..f67d6716e 100644 --- a/grep.c +++ b/grep.c @@ -1,5 +1,6 @@ #include "cache.h" #include "grep.h" +#include "xdiff-interface.h" void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t) @@ -232,17 +233,6 @@ static void show_line(struct grep_opt *opt, const char *bol, const char *eol, printf("%.*s\n", (int)(eol-bol), bol); } -/* - * NEEDSWORK: share code with diff.c - */ -#define FIRST_FEW_BYTES 8000 -static int buffer_is_binary(const char *ptr, unsigned long size) -{ - if (FIRST_FEW_BYTES < size) - size = FIRST_FEW_BYTES; - return !!memchr(ptr, 0, size); -} - static int fixmatch(const char *pattern, char *line, regmatch_t *match) { char *hit = strstr(line, pattern);