summaryrefslogtreecommitdiff
path: root/libiberty/fnmatch.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-08 03:00:26 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-08 03:00:26 +0000
commit93ce8ce482727708b0c8fc921e421b862e2b7ca4 (patch)
treeb03b87c4d027ec11c1f46fa69792393daa187ec4 /libiberty/fnmatch.c
parentef0962405a9a06dc5ce7be5d9f94f05f3d285741 (diff)
downloadgcc-93ce8ce482727708b0c8fc921e421b862e2b7ca4.tar.gz
include:
* safe-ctype.h: New file. libiberty: * safe-ctype.c: New file. * Makefile.in (CFILES): Add safe-ctype.c. (REQUIRED_OFILES): Add safe-ctype.o. * argv.c: Define ISBLANK and use it, not isspace. * basename.c, cplus-dem.c, fnmatch.c, pexecute.c, strtod.c, strtol.c, strtoul.c: Include safe-ctype.h, not ctype.h. Use uppercase ctype macros. Don't test ISUPPER(c)/ISLOWER(c) before calling TOLOWER(c)/TOUPPER(c). gcc: * Makefile.in (HOST_RTL): Add safe-ctype.o. (safe-ctype.o): New rule. * system.h: Include safe-ctype.h, not ctype.h. No need to wrap ctype macros. * cpphash.h: Zap IStable and related macros. Define is_* in terms of safe-ctype.h macros. * cppinit.c: Delete the IStable and all related code. * tradcpp.c: Delete is_idchar, is_idstart, is_hor_space, and is_space arrays. Delete initialize_char_syntax. Change all references to the above arrays to use macros instead. * tradcpp.h: Define is_idchar, is_idstart, is_space, and is_nvspace in terms of safe_ctype.h's macros. * tradcif.y: is_idchar, is_idstart are macros not arrays. * config/i370/i370.c, config/winnt/dirent.c, config/winnt/fixinc-nt.c, config/winnt/ld.c: Use uppercase ctype macros. If we included ctype.h, include safe-ctype.h instead. * fixinc/fixfixes.c: Use uppercase ctype macros. Don't test ISLOWER(c) before calling TOUPPER(c). * fixinc/fixincl.c (extract_quoted_files): Simplify out some gunk. * fixinc/gnu-regex.c: Include safe-ctype.h, not ctype.h. No need to wrap ctype macros. Don't test ISUPPER(x) before calling TOLOWER(x). gcc/ch: * lex.c: Don't bother checking whether ISUPPER(c) before calling TOLOWER(c). Don't bother checking whether isascii(c) before testing ISSPACE(c); ISSPACE(c) includes '\n'. gcc/f: * Make-lang.in: Link f/fini with safe-ctype.o. * bad.c: Don't test ISUPPER(c) || ISLOWER(c) before calling TOUPPER(c). * com.c: Use TOUPPER, not ffesrc_toupper. * fini.c: Don't test ISALPHA(c) before calling TOUPPER(c)/TOLOWER(c). * intrin.c: Don't test IN_CTYPE_DOMAIN(c). * src.c: Delete ffesrc_toupper_ and ffesrc_tolower_ and their initializing code; use TOUPPER and TOLOWER instead of ffesrc_toupper and ffesrc_tolower. * src.h: Don't declare ffesrc_toupper_ or ffesrc_tolower_. Don't define ffesrc_toupper or ffesrc_tolower. gcc/java: * jvgenmain.c: Use ISPRINT not isascii. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38124 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/fnmatch.c')
-rw-r--r--libiberty/fnmatch.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libiberty/fnmatch.c b/libiberty/fnmatch.c
index 0a9bfe6152b..68f3e267996 100644
--- a/libiberty/fnmatch.c
+++ b/libiberty/fnmatch.c
@@ -45,8 +45,7 @@ Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <fnmatch.h>
-#include <ctype.h>
-
+#include <safe-ctype.h>
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
@@ -74,8 +73,7 @@ fnmatch (pattern, string, flags)
register const char *p = pattern, *n = string;
register unsigned char c;
-/* Note that this evalutes C many times. */
-#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
+#define FOLD(c) ((flags & FNM_CASEFOLD) ? TOLOWER (c) : (c))
while ((c = *p++) != '\0')
{