1 |
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. |
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. |
2 |
|
|
3 |
NOTE: The canonical source of this file is maintained with the GNU C Library. |
NOTE: This source is derived from an old version taken from the GNU C |
4 |
Bugs can be reported to bug-glibc@prep.ai.mit.edu. |
Library (glibc). |
5 |
|
|
6 |
This program is free software; you can redistribute it and/or modify it |
This program is free software; you can redistribute it and/or modify it |
7 |
under the terms of the GNU General Public License as published by the |
under the terms of the GNU General Public License as published by the |
45 |
|
|
46 |
#include <errno.h> |
#include <errno.h> |
47 |
#include <fnmatch.h> |
#include <fnmatch.h> |
48 |
#include <ctype.h> |
#include <safe-ctype.h> |
|
|
|
49 |
|
|
50 |
/* Comment out all this code if we are using the GNU C Library, and are not |
/* Comment out all this code if we are using the GNU C Library, and are not |
51 |
actually compiling the library itself. This code is part of the GNU C |
actually compiling the library itself. This code is part of the GNU C |
73 |
register const char *p = pattern, *n = string; |
register const char *p = pattern, *n = string; |
74 |
register unsigned char c; |
register unsigned char c; |
75 |
|
|
76 |
/* Note that this evalutes C many times. */ |
#define FOLD(c) ((flags & FNM_CASEFOLD) ? TOLOWER (c) : (c)) |
|
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c)) |
|
77 |
|
|
78 |
while ((c = *p++) != '\0') |
while ((c = *p++) != '\0') |
79 |
{ |
{ |