From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30475 invoked by alias); 6 Apr 2007 09:05:58 -0000 Received: (qmail 30465 invoked by uid 22791); 6 Apr 2007 09:05:57 -0000 X-Spam-Check-By: sourceware.org Received: from heller.inter.net.il (HELO heller.inter.net.il) (213.8.233.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 06 Apr 2007 10:05:51 +0100 Received: from HOME-C4E4A596F7 (IGLD-84-228-45-129.inter.net.il [84.228.45.129]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id CGY38571 (AUTH halo1); Fri, 6 Apr 2007 12:05:43 +0300 (IDT) Date: Fri, 06 Apr 2007 09:05:00 -0000 Message-Id: From: Eli Zaretskii To: Joel Brobecker CC: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org In-reply-to: <20070406061218.GB3471@adacore.com> (message from Joel Brobecker on Thu, 5 Apr 2007 23:12:18 -0700) Subject: Re: [RFA/libiberty] Fix documentation issues in filename_cmp.c Reply-to: Eli Zaretskii References: <20070405172720.GB9281@adacore.com> <20070406061218.GB3471@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/msg00027.txt.bz2 > Date: Thu, 5 Apr 2007 23:12:18 -0700 > From: Joel Brobecker > Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org > > Eli, > > > > 2007-04-05 Joel Brobecker > > > > > > * filename_cmp.c (filename_cmp): Improve documentation. > > > > Thanks, I am happy, as far as the documentation goes. > > Am I to understand that you are not happy with the code? Well, I did have comments about that, and they were left unresolved ;-) > 1. Fold multiple consecutive slash/backslash characters into > single slash/backslash; > > To do that without modifying the source filenames, we need to > allocate some memory locally to manipulate a copy of that filename. This is a misunderstanding: I didn't mean that we should modify the source file names. What I meant is that the comparison should ignore multiple consecutive slashes, so that, say, "/foo/bar/baz" compares equal to "/foo//bar////baz" (and to "\foo//bar\/\baz" on Windows). (However, note that, as Chris pointed out, double slash at the beginning of a file name, as in "//foo/bar", are significant on Windows.) > My take on this is that the file names we have seen, at least in > the debugging information, have been consistent; and thus this > enhancement would end up having no actual effect. I would wait > until we come across a case where this is a problem before > going that way. I've seen quite a few of such situations, actually. And in any case, good engineering doesn't need examples to know what's Right ;-) > 2. The possible introduction of a bug with certain locales because > the function used in place of strcasecmp uses tolower. > > For this one, as I said, I don't know, and I'm not sure where > to start looking for the answer. How about using your function with LANG set to various values? That should at least tell us whether strcasecmp and tolower do the same thing; if they do, there's no problem here.