diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/buf_text.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buf_text.c b/src/buf_text.c index 472339def..ecf592b51 100644 --- a/src/buf_text.c +++ b/src/buf_text.c @@ -170,8 +170,14 @@ int git_buf_text_common_prefix(git_buf *buf, const git_strarray *strings) bool git_buf_text_is_binary(const git_buf *buf) { const char *scan = buf->ptr, *end = buf->ptr + buf->size; + git_bom_t bom; int printable = 0, nonprintable = 0; + scan += git_buf_text_detect_bom(&bom, buf, 0); + + if (bom > GIT_BOM_UTF8) + return 1; + while (scan < end) { unsigned char c = *scan++; |
