From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4067 invoked by alias); 11 Apr 2007 20:33:50 -0000 Received: (qmail 4055 invoked by uid 22791); 11 Apr 2007 20:33:49 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Apr 2007 21:33:44 +0100 Received: from zps78.corp.google.com (zps78.corp.google.com [172.25.146.78]) by smtp-out.google.com with ESMTP id l3BKXMxT006024; Wed, 11 Apr 2007 13:33:22 -0700 Received: from localhost.localdomain.google.com (dhcp-172-18-116-229.corp.google.com [172.18.116.229]) (authenticated bits=0) by zps78.corp.google.com with ESMTP id l3BKWxhv025158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 11 Apr 2007 13:33:01 -0700 To: Eli Zaretskii Cc: Joel Brobecker , drow@false.org, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Subject: Re: [RFA/libiberty] Fix documentation issues in filename_cmp.c References: <20070405172720.GB9281@adacore.com> <20070406061218.GB3471@adacore.com> <20070407173500.GC24650@caradoc.them.org> <20070411072615.GB3648@adacore.com> From: Ian Lance Taylor Date: Wed, 11 Apr 2007 20:33:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00149.txt.bz2 Eli Zaretskii writes: > > 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. For locale-independent case conversion, use TOLOWER or TOUPPER in include/safe-ctype.h. Ian