From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19504 invoked by alias); 3 May 2007 15:36:30 -0000 Received: (qmail 19483 invoked by uid 22791); 3 May 2007 15:36:27 -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; Thu, 03 May 2007 15:36:24 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id C551048CC07; Thu, 3 May 2007 11:36:22 -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 15198-01-10; Thu, 3 May 2007 11:36:22 -0400 (EDT) Received: from joel.gnat.com (unknown [70.71.0.212]) by nile.gnat.com (Postfix) with ESMTP id 5EAA948CEC8; Thu, 3 May 2007 11:36:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id E7216E7B4F; Thu, 3 May 2007 19:36:17 +0400 (RET) Date: Thu, 03 May 2007 15:36:00 -0000 From: Joel Brobecker To: Ian Lance Taylor Cc: Eli Zaretskii , drow@false.org, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Subject: [RFA/libiberty] use TOLOWER instead of tolower in filename_cmp.c Message-ID: <20070503153617.GB8864@adacore.com> References: <20070405172720.GB9281@adacore.com> <20070406061218.GB3471@adacore.com> <20070407173500.GC24650@caradoc.them.org> <20070411072615.GB3648@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" 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-05/txt/msg00043.txt.bz2 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 553 > For locale-independent case conversion, use TOLOWER or TOUPPER in > include/safe-ctype.h. Thanks for the suggestion, Ian. Now that I'm back, here is a patch that implements it. 2007-05-03 Joel Brobecker * filename_cmp.c: Replace include of ctype.h by include of safe-ctype.h. (filename_cmp): Use TOLOWER instead of tolower for conversions that are locale-independent. * Makefile.in (filename_cmp.o): Add dependency on safe-ctype.h. Tested on x86-linux and x86-windows. No regression. OK to commit? Thanks, -- Joel --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tolower.diff" Content-length: 1407 Index: filename_cmp.c =================================================================== RCS file: /cvs/src/src/libiberty/filename_cmp.c,v retrieving revision 1.3 diff -u -p -r1.3 filename_cmp.c --- filename_cmp.c 6 Apr 2007 06:01:54 -0000 1.3 +++ filename_cmp.c 1 May 2007 22:09:55 -0000 @@ -24,8 +24,8 @@ #include #endif -#include #include "filenames.h" +#include "safe-ctype.h" /* @@ -55,8 +55,8 @@ filename_cmp (const char *s1, const char #else for (;;) { - int c1 = tolower (*s1); - int c2 = tolower (*s2); + int c1 = TOLOWER (*s1); + int c2 = TOLOWER (*s2); /* On DOS-based file systems, the '/' and the '\' are equivalent. */ if (c1 == '/') Index: Makefile.in =================================================================== RCS file: /cvs/src/src/libiberty/Makefile.in,v retrieving revision 1.86 diff -u -p -r1.86 Makefile.in --- Makefile.in 29 Mar 2007 21:03:48 -0000 1.86 +++ Makefile.in 1 May 2007 22:09:55 -0000 @@ -651,7 +651,8 @@ $(CONFIGURED_OFILES): stamp-picdir else true; fi $(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION) -./filename_cmp.o: $(srcdir)/filename_cmp.c $(INCDIR)/filenames.h +./filename_cmp.o: $(srcdir)/filename_cmp.c $(INCDIR)/filenames.h \ + $(INCDIR)/safe-ctype.h if [ x"$(PICFLAG)" != x ]; then \ $(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \ else true; fi --HlL+5n6rz5pIUxbD--