@@ -52,6 +52,20 @@ static void free_mailmap_entry(void *p, const char *s)
5252 string_list_clear_func (& me -> namemap , free_mailmap_info );
5353}
5454
55+ /*
56+ * On some systems (e.g. MinGW 4.0), string.h has _only_ inline
57+ * definition of strcasecmp and no non-inline implementation is
58+ * supplied anywhere, which is, eh, "unusual"; we cannot take an
59+ * address of such a function to store it in namemap.cmp. This is
60+ * here as a workaround---do not assign strcasecmp directly to
61+ * namemap.cmp until we know no systems that matter have such an
62+ * "unusual" string.h.
63+ */
64+ static int namemap_cmp (const char * a , const char * b )
65+ {
66+ return strcasecmp (a , b );
67+ }
68+
5569static void add_mapping (struct string_list * map ,
5670 char * new_name , char * new_email ,
5771 char * old_name , char * old_email )
@@ -75,7 +89,7 @@ static void add_mapping(struct string_list *map,
7589 item = string_list_insert_at_index (map , index , old_email );
7690 me = xcalloc (1 , sizeof (struct mailmap_entry ));
7791 me -> namemap .strdup_strings = 1 ;
78- me -> namemap .cmp = strcasecmp ;
92+ me -> namemap .cmp = namemap_cmp ;
7993 item -> util = me ;
8094 }
8195
@@ -237,7 +251,7 @@ int read_mailmap(struct string_list *map, char **repo_abbrev)
237251 int err = 0 ;
238252
239253 map -> strdup_strings = 1 ;
240- map -> cmp = strcasecmp ;
254+ map -> cmp = namemap_cmp ;
241255
242256 if (!git_mailmap_blob && is_bare_repository ())
243257 git_mailmap_blob = "HEAD:.mailmap" ;
0 commit comments