summaryrefslogtreecommitdiff
path: root/libiberty/fnmatch.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2000-12-08 16:37:01 +0000
committerDJ Delorie <dj@delorie.com>2000-12-08 16:37:01 +0000
commit35321415e808e149edd05fce61d771bc30503624 (patch)
tree3b647cbaf9d250da6cc15f32b5d946bec6f65325 /libiberty/fnmatch.c
parentff973f2271429b95f36a4ae299824f33e775c7c9 (diff)
downloadgdb-35321415e808e149edd05fce61d771bc30503624.tar.gz
* 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).
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')
{