@@ -52,6 +52,20 @@ static void free_mailmap_entry(void *p, const char *s)
52
52
string_list_clear_func (& me -> namemap , free_mailmap_info );
53
53
}
54
54
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
+
55
69
static void add_mapping (struct string_list * map ,
56
70
char * new_name , char * new_email ,
57
71
char * old_name , char * old_email )
@@ -75,7 +89,7 @@ static void add_mapping(struct string_list *map,
75
89
item = string_list_insert_at_index (map , index , old_email );
76
90
me = xcalloc (1 , sizeof (struct mailmap_entry ));
77
91
me -> namemap .strdup_strings = 1 ;
78
- me -> namemap .cmp = strcasecmp ;
92
+ me -> namemap .cmp = namemap_cmp ;
79
93
item -> util = me ;
80
94
}
81
95
@@ -237,7 +251,7 @@ int read_mailmap(struct string_list *map, char **repo_abbrev)
237
251
int err = 0 ;
238
252
239
253
map -> strdup_strings = 1 ;
240
- map -> cmp = strcasecmp ;
254
+ map -> cmp = namemap_cmp ;
241
255
242
256
if (!git_mailmap_blob && is_bare_repository ())
243
257
git_mailmap_blob = "HEAD:.mailmap" ;
0 commit comments