summaryrefslogtreecommitdiff
path: root/src/diff_output.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-28 09:58:48 -0800
committerRussell Belfer <rb@github.com>2012-11-28 09:58:48 -0800
commit7bf87ab6987cf6b9e166e23d2d9dbdcd2511fb32 (patch)
treedcc8a92ce69b2a0d9d8cca98d67f0cc71177ce40 /src/diff_output.c
parent693021262ba0eeac2923bbce1b2262717019c807 (diff)
downloadlibgit2-7bf87ab6987cf6b9e166e23d2d9dbdcd2511fb32.tar.gz
Consolidate text buffer functions
There are many scattered functions that look into the contents of buffers to do various text manipulations (such as escaping or unescaping data, calculating text stats, guessing if content is binary, etc). This groups all those functions together into a new file and converts the code to use that. This has two enhancements to existing functionality. The old text stats function is significantly rewritten and the BOM detection code was extended (although largely we can't deal with anything other than a UTF8 BOM).
Diffstat (limited to 'src/diff_output.c')
-rw-r--r--src/diff_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/diff_output.c b/src/diff_output.c
index 3d5e03a29..e137fd0f2 100644
--- a/src/diff_output.c
+++ b/src/diff_output.c
@@ -142,7 +142,7 @@ static int diff_delta_is_binary_by_content(
search.ptr = map->data;
search.size = min(map->len, 4000);
- if (git_buf_is_binary(&search))
+ if (git_buf_text_is_binary(&search))
file->flags |= GIT_DIFF_FILE_BINARY;
else
file->flags |= GIT_DIFF_FILE_NOT_BINARY;