From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3044 invoked by alias); 15 Jun 2011 08:22:58 -0000 Received: (qmail 3021 invoked by uid 22791); 15 Jun 2011 08:22:54 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_FAIL,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mail-n.franken.de (HELO mail-n.franken.de) (193.175.24.27) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Jun 2011 08:22:39 +0000 Received: from aqua.hirmke.de (aquarius.franken.de [193.175.24.89]) by mail-n.franken.de (Postfix) with ESMTP id 85FF31C0B4620; Wed, 15 Jun 2011 10:22:37 +0200 (CEST) Received: from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6]) by aqua.hirmke.de (Postfix) with ESMTP id 8363A26C09D; Wed, 15 Jun 2011 10:22:36 +0200 (CEST) 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 09:30: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) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01138.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