From: Joel Brobecker <brobecker@adacore.com>
To: Ian Lance Taylor <iant@google.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
drow@false.org, gcc-patches@gcc.gnu.org,
gdb-patches@sourceware.org
Subject: [RFA/libiberty] use TOLOWER instead of tolower in filename_cmp.c
Date: Thu, 03 May 2007 15:36:00 -0000 [thread overview]
Message-ID: <20070503153617.GB8864@adacore.com> (raw)
In-Reply-To: <m31wiqabyd.fsf@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
> 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 <brobecker@adacore.com>
* 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
[-- Attachment #2: tolower.diff --]
[-- Type: text/plain, Size: 1407 bytes --]
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 <string.h>
#endif
-#include <ctype.h>
#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
next prev parent reply other threads:[~2007-05-03 15:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 17:27 [RFA/libiberty] Fix documentation issues " Joel Brobecker
2007-04-05 18:36 ` DJ Delorie
2007-04-06 6:02 ` Joel Brobecker
2007-04-05 18:44 ` Eli Zaretskii
2007-04-06 6:10 ` Joel Brobecker
2007-04-06 9:05 ` Eli Zaretskii
2007-04-06 10:00 ` Dave Korn
2007-04-07 17:35 ` Daniel Jacobowitz
2007-04-07 17:52 ` Eli Zaretskii
2007-04-11 7:24 ` Joel Brobecker
2007-04-11 18:28 ` Eli Zaretskii
2007-04-11 20:33 ` Ian Lance Taylor
2007-05-03 15:36 ` Joel Brobecker [this message]
2007-05-03 16:31 ` [RFA/libiberty] use TOLOWER instead of tolower " Ian Lance Taylor
2007-05-03 23:40 ` Joel Brobecker
2007-05-04 7:18 ` Eli Zaretskii
2007-04-11 7:27 ` [RFA/libiberty] Fix documentation issues " Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070503153617.GB8864@adacore.com \
--to=brobecker@adacore.com \
--cc=drow@false.org \
--cc=eliz@gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=iant@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox