This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> > 2.  Glibc's strcasecmp uses tolower and honors LC_COLLATE.
> 
> But the version in libiberty only handles ASCII.
> 
> > Which behavior do we want here, anyway?  I'm not sure...
> 
> I think we should fold only ASCII characters, since it's consistent
> with libiberty's strcasecmp.

If we follow your recommendation, I think the best approach is to
use strcasecmp after having changed forward slashes into backward
slashes like I did in my first implementation. That way, we let
strcasecmp deal with the folding.

The downside is that we now end up having to allocate some memory
to hold a copy of the two filenames (in order to do the fixup on
slashes above), whereas we don't need that right now. This is something
that will be needed eventually if someone wants to enhance it to
handle multiple slashes, etc. So adding the couple of string copies
now isn't so bad.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]