Re: [PATCH 1/3] utf8-bom: introduce skip_utf8_bom() helper

2015-04-16 Thread Junio C Hamano
Jeff King writes: > On Thu, Apr 16, 2015 at 10:52:52AM -0700, Junio C Hamano wrote: > >> @@ -576,10 +576,8 @@ int add_excludes_from_file_to_list(const char *fname, >> >> el->filebuf = buf; >> >> -if (size >= 3 && !memcmp(buf, utf8_bom, 3)) >> -entry = buf + 3; >> -els

Re: [PATCH 1/3] utf8-bom: introduce skip_utf8_bom() helper

2015-04-16 Thread Jeff King
On Thu, Apr 16, 2015 at 10:52:52AM -0700, Junio C Hamano wrote: > @@ -576,10 +576,8 @@ int add_excludes_from_file_to_list(const char *fname, > > el->filebuf = buf; > > - if (size >= 3 && !memcmp(buf, utf8_bom, 3)) > - entry = buf + 3; > - else > - entry =

[PATCH 1/3] utf8-bom: introduce skip_utf8_bom() helper

2015-04-16 Thread Junio C Hamano
With the recent change to ignore the UTF8 BOM at the beginning of .gitignore files, we now have two codepaths that do such a skipping (the other one is for reading the configuration files). Introduce utf8_bom[] constant string and skip_utf8_bom() helper and teach .gitignore code how to use it. Si