Re: [RFA/libiberty] Fix documentation issues in filename_cmp.c

Daniel Jacobowitz
2007-04-07T17:35:05Z

On Fri, Apr 06, 2007 at 12:05:54PM +0300, Eli Zaretskii wrote:
> > 2. The possible introduction of a bug with certain locales because
> > the function used in place of strcasecmp uses tolower.
> >
> > For this one, as I said, I don't know, and I'm not sure where
> > to start looking for the answer.
>
> How about using your function with LANG set to various values? That
> should at least tell us whether strcasecmp and tolower do the same
> thing; if they do, there's no problem here.

For what it's worth, here's what I know about this:

1. POSIX says:

In the POSIX locale, strcasecmp() and strncasecmp() shall behave as if
the strings had been converted to lowercase and then a byte comparison
performed. The results are unspecified in other locales.

2. Glibc's strcasecmp uses tolower and honors LC_COLLATE.

Which behavior do we want here, anyway? I'm not sure...

--
Daniel Jacobowitz
CodeSourcery