X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-grep.c;h=2bfbdb71407dcd0ddfe970f6a614158d954cd4c0;hb=6900679c2f6d937a5a6ef616869c8887690ad19d;hp=9873e3d1dbf0e8735641cc178d687a9d5194487e;hpb=88ffc1f28a8b86969c7cbc54b0e3279d8cfe90a8;p=git.git diff --git a/builtin-grep.c b/builtin-grep.c index 9873e3d1d..2bfbdb714 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -10,10 +10,7 @@ #include "tag.h" #include "tree-walk.h" #include "builtin.h" -#include #include "grep.h" -#include -#include /* * git grep pathspecs are somewhat different from diff-tree pathspecs; @@ -139,7 +136,7 @@ static int grep_file(struct grep_opt *opt, const char *filename) if (i < 0) goto err_ret; data = xmalloc(st.st_size + 1); - if (st.st_size != xread(i, data, st.st_size)) { + if (st.st_size != read_in_full(i, data, st.st_size)) { error("'%s': short read %s", filename, strerror(errno)); close(i); free(data);