Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-28 21:58:48 +0400
committerRussell Belfer <rb@github.com>2012-11-28 21:58:48 +0400
commit7bf87ab6987cf6b9e166e23d2d9dbdcd2511fb32 (patch)
treedcc8a92ce69b2a0d9d8cca98d67f0cc71177ce40 /src/config.c
parent693021262ba0eeac2923bbce1b2262717019c807 (diff)
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/config.c')
-rw-r--r--src/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 5ee0d39ff..6347f7df7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -10,6 +10,7 @@
#include "config.h"
#include "git2/config.h"
#include "vector.h"
+#include "buf_text.h"
#if GIT_WIN32
# include <windows.h>
#endif
@@ -803,7 +804,7 @@ int git_config_rename_section(
int error = -1;
struct rename_data data;
- git_buf_puts_escape_regex(&pattern, old_section_name);
+ git_buf_text_puts_escape_regex(&pattern, old_section_name);
git_buf_puts(&pattern, "\\..+");
if (git_buf_oom(&pattern))
goto cleanup;