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

Eli Zaretskii eliz@gnu.org
Wed Apr 11 18:28:00 GMT 2007


> Date: Wed, 11 Apr 2007 09:26:15 +0200
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Daniel Jacobowitz <drow@false.org>, gcc-patches@gcc.gnu.org,
> 	gdb-patches@sourceware.org
> 
> > 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.

That's one way, but, as you point out, it has drawbacks.  So my advice
would be to compare individual characters so that A-Za-z compare
case-insensitively.  A simple macro or inline function should be able
to do this.  For example, if you mask the 5th bit, upper-case and
lower-case ASCII will be the same.



More information about the Gdb-patches mailing list