From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12862 invoked by alias); 11 Apr 2007 07:24:35 -0000 Received: (qmail 12843 invoked by uid 22791); 11 Apr 2007 07:24:34 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Apr 2007 08:24:32 +0100 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id 3FAD348CF43; Wed, 11 Apr 2007 03:24:30 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05827-01-4; Wed, 11 Apr 2007 03:24:30 -0400 (EDT) Received: from joel.gnat.com (dhcp-guest.act-europe.fr [212.157.227.127]) by nile.gnat.com (Postfix) with ESMTP id 0200A48CD92; Wed, 11 Apr 2007 03:24:29 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1DCFDE7B4C; Wed, 11 Apr 2007 09:26:15 +0200 (CEST) Date: Wed, 11 Apr 2007 07:24:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: Daniel Jacobowitz , gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Subject: Re: [RFA/libiberty] Fix documentation issues in filename_cmp.c Message-ID: <20070411072615.GB3648@adacore.com> References: <20070405172720.GB9281@adacore.com> <20070406061218.GB3471@adacore.com> <20070407173500.GC24650@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i 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/msg00130.txt.bz2 > > 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