From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5235 invoked by alias); 15 Jun 2011 08:23:23 -0000 Received: (qmail 3020 invoked by uid 22791); 15 Jun 2011 08:22:54 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Wed, 15 Jun 2011 08:22:39 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 4D18F2CAFA6; Wed, 15 Jun 2011 10:22:36 +0200 (CEST) Date: Wed, 15 Jun 2011 08:23:00 -0000 From: Corinna Vinschen To: DJ Delorie Cc: Andrew Pinski , brobecker@adacore.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Subject: Re: [RFA/libiberty] Darwin has case-insensitive filesystems Message-ID: <20110615082236.GP12140@calimero.vinschen.de> Mail-Followup-To: DJ Delorie , Andrew Pinski , brobecker@adacore.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org References: <1308087182-26577-1-git-send-email-brobecker@adacore.com> <201106142201.p5EM1vOd006127@greed.delorie.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201106142201.p5EM1vOd006127@greed.delorie.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-06/txt/msg00207.txt.bz2 On Jun 14 18:01, DJ Delorie wrote: > > > This is wrong as not all FSs are case insensitive. In fact HFS+ can > > be case sensitive too. I think you need better check than just > > saying all Darwin is case insensitive. This is just like using > > FAT32 on Linux. In fact I think HAVE_DOS_BASED_FILE_SYSTEM is > > incorrect also for NTFS as it can also be case sensitive. > > There's a difference between case preserving and case sensitive, > though, and we really don't have a portable way to detect > case-sensitivity on a per-directory basis, sow how can we do better? As Andrew points out, NTFS can be case-sensitive as well, and on Windows the case-sensitivity vs. case-preserving behaviour can be chosen for each file or directory descriptor at the time the file is opened. IMHO it's actually a pity that the filename comparison behaves differently on different systems. I think it would make sense to behave identical on all systems. What about this: Always search case-sensitive. If file has been found, return. Otherwise, search case-insensitive. Talking about case-insensitive comparison, the filename_cmp and filename_ncmp functions don't work for multibyte codesets, only for singlebyte codesets. Given that UTF-8 is standard nowadays, shouldn't these functions be replaced with multibyte-aware versions? Along the same lines, the entire set of safe-ctype functions only work for ASCII and EBCDIC... Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat