Signed-off-by: Junio C Hamano <gits...@pobox.com>
---
 attr.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/attr.c b/attr.c
index cd54697..7c530f4 100644
--- a/attr.c
+++ b/attr.c
@@ -12,6 +12,7 @@
 #include "exec_cmd.h"
 #include "attr.h"
 #include "dir.h"
+#include "utf8.h"
 
 const char git_attr__true[] = "(builtin)true";
 const char git_attr__false[] = "\0(builtin)false";
@@ -369,8 +370,12 @@ static struct attr_stack *read_attr_from_file(const char 
*path, int macro_ok)
                return NULL;
        }
        res = xcalloc(1, sizeof(*res));
-       while (fgets(buf, sizeof(buf), fp))
-               handle_attr_line(res, buf, path, ++lineno, macro_ok);
+       while (fgets(buf, sizeof(buf), fp)) {
+               char *bufp = buf;
+               if (!lineno)
+                       skip_utf8_bom(&bufp, strlen(bufp));
+               handle_attr_line(res, bufp, path, ++lineno, macro_ok);
+       }
        fclose(fp);
        return res;
 }
-- 
2.4.0-rc2-171-g98ddf7f

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to