ZheNing Hu wrote: > Junio C Hamano <gitster@xxxxxxxxx> 于2021年5月28日周五 上午11:04写道: > > "ZheNing Hu via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > > > +static int memcasecmp(const void *vs1, const void *vs2, size_t n) > > > +{ > > > + size_t i; > > > + const char *s1 = (const char *)vs1; > > > + const char *s2 = (const char *)vs2; > > > + > > > + for (i = 0; i < n; i++) { > > > + unsigned char u1 = s1[i]; > > > + unsigned char u2 = s2[i]; > > > + int U1 = toupper (u1); > > > + int U2 = toupper (u2); > > > > Does toupper('\0') even have a defined meaning? > Forget about this inelegant help function. As I said in my reply to Felipe, > this is copied from gunlib... Even if you use my modified version (which hopefully is not so inelegant), the comment about toupper('\0') still applies. My reading of `man toupper(3)` is that if c is neither lowercase or uppercase it is returned as-is. As long as it's unsigned char, which '\0' is. So I think the behavior is indeed defined. -- Felipe Contreras