From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11607 invoked by alias); 11 Apr 2007 18:28:48 -0000 Received: (qmail 11597 invoked by uid 22791); 11 Apr 2007 18:28:47 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (213.8.233.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Apr 2007 19:28:41 +0100 Received: from HOME-C4E4A596F7 (IGLD-84-228-6-20.inter.net.il [84.228.6.20]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id GML23121 (AUTH halo1); Wed, 11 Apr 2007 21:28:33 +0300 (IDT) Date: Wed, 11 Apr 2007 18:28:00 -0000 Message-Id: From: Eli Zaretskii To: Joel Brobecker CC: drow@false.org, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org In-reply-to: <20070411072615.GB3648@adacore.com> (message from Joel Brobecker on Wed, 11 Apr 2007 09:26:15 +0200) Subject: Re: [RFA/libiberty] Fix documentation issues in filename_cmp.c Reply-to: Eli Zaretskii References: <20070405172720.GB9281@adacore.com> <20070406061218.GB3471@adacore.com> <20070407173500.GC24650@caradoc.them.org> <20070411072615.GB3648@adacore.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00146.txt.bz2 > Date: Wed, 11 Apr 2007 09:26:15 +0200 > From: Joel Brobecker > Cc: Daniel Jacobowitz , 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.