Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
Fix push with refspecs containing wildcards
[gitweb.git]
/
xdiff-interface.c
diff --git
a/xdiff-interface.c
b/xdiff-interface.c
index 10816e95a07c23dda7554c102c306d7e9beca606..e407cf11b1d8ba28be64eda7bcb505d9edb4d253 100644
(file)
--- a/
xdiff-interface.c
+++ b/
xdiff-interface.c
@@
-122,4
+122,10
@@
int read_mmfile(mmfile_t *ptr, const char *filename)
return 0;
}
-
+#define FIRST_FEW_BYTES 8000
+int buffer_is_binary(const char *ptr, unsigned long size)
+{
+ if (FIRST_FEW_BYTES < size)
+ size = FIRST_FEW_BYTES;
+ return !!memchr(ptr, 0, size);
+}