Re: [PATCH 1/2] [GSOC] ref-filter: add %(raw) atom
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 28, 2021, 16:38 UTC
- Message-ID
- <60b11ca3bfdb1_4b03220842@natae.notmuch>
- In-Reply-To
- <CAOLTT8SLLgZnF0SV2FPPBJkB=ybeh8mamTPqc-M6CXQeepooOQ@mail.gmail.com>
ZheNing Hu wrote:
> Junio C Hamano <gitster@pobox.com> 于2021年5月28日周五 上午11:04写道: > > "ZheNing Hu via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 13 quoted lines
> > > +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