X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=utf8.c;h=28e6d76a425db4c16a8cc32e6f17c7aa72c2b1f0;hb=f330f1f53ea2c576f47dc4d63d0b9c819f6a716a;hp=520fbb4994ab1bdcfa0bc4589a0ca5131a89c490;hpb=919cec9979a865f8169eaa30e5ff6de8e4fe5565;p=platform%2Fupstream%2Fgit.git diff --git a/utf8.c b/utf8.c index 520fbb4..28e6d76 100644 --- a/utf8.c +++ b/utf8.c @@ -633,3 +633,14 @@ int is_hfs_dotgit(const char *path) return 1; } + +const char utf8_bom[] = "\357\273\277"; + +int skip_utf8_bom(char **text, size_t len) +{ + if (len < strlen(utf8_bom) || + memcmp(*text, utf8_bom, strlen(utf8_bom))) + return 0; + *text += strlen(utf8_bom); + return 1; +}