aboutsummaryrefslogtreecommitdiff
path: root/utf8.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-13 14:05:51 -0700
committerJunio C Hamano <gitster@pobox.com>2015-05-13 14:05:51 -0700
commit8a1d89745d1b60d0d9e8bd91e4e9564673b6c22a (patch)
treeeef6bd2437ba2a1188dbe1b4023b27ef99531b65 /utf8.h
parentebb464f0cba9efcb5552fad02f452f09f68fc9b2 (diff)
parent27547e5fccda134560ad0441aa5bfa187387cec0 (diff)
downloadgit-8a1d89745d1b60d0d9e8bd91e4e9564673b6c22a.tar.xz
Merge branch 'cn/bom-in-gitignore' into maint
Teach the codepaths that read .gitignore and .gitattributes files that these files encoded in UTF-8 may have UTF-8 BOM marker at the beginning; this makes it in line with what we do for configuration files already. * cn/bom-in-gitignore: attr: skip UTF8 BOM at the beginning of the input file config: use utf8_bom[] from utf.[ch] in git_parse_source() utf8-bom: introduce skip_utf8_bom() helper add_excludes_from_file: clarify the bom skipping logic dir: allow a BOM at the beginning of exclude files
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
index e4d9183c5f..e7b2aa4168 100644
--- a/utf8.h
+++ b/utf8.h
@@ -13,6 +13,9 @@ int same_encoding(const char *, const char *);
__attribute__((format (printf, 2, 3)))
int utf8_fprintf(FILE *, const char *, ...);
+extern const char utf8_bom[];
+extern int skip_utf8_bom(char **, size_t);
+
void strbuf_add_wrapped_text(struct strbuf *buf,
const char *text, int indent, int indent2, int width);
void strbuf_add_wrapped_bytes(struct strbuf *buf, const char *data, int len,