~ubuntu-branches/ubuntu/natty/diffutils/natty

« back to all changes in this revision

Viewing changes to lib/fnmatch.c

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2010-05-04 20:38:00 UTC
  • mfrom: (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100504203800-f67xd9rsa9xl9qqj
Tags: 1:3.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 1991, 1992, 1993, 1996, 1997, 2000 Free Software Foundation, Inc.
 
1
/* -*- buffer-read-only: t -*- vi: set ro: */
 
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 
3
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
 
4
   2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
2
5
 
3
6
   This program is free software; you can redistribute it and/or modify
4
7
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; either version 2, or (at your option)
 
8
   the Free Software Foundation; either version 3, or (at your option)
6
9
   any later version.
7
10
 
8
11
   This program is distributed in the hope that it will be useful,
10
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
14
   GNU General Public License for more details.
12
15
 
13
 
  You should have received a copy of the GNU General Public License
14
 
  along with this program; if not, write to the Free Software Foundation,
15
 
  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program; if not, write to the Free Software Foundation,
 
18
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
16
19
 
17
 
#if HAVE_CONFIG_H
 
20
#ifndef _LIBC
18
21
# include <config.h>
19
22
#endif
20
23
 
21
24
/* Enable GNU extensions in fnmatch.h.  */
22
25
#ifndef _GNU_SOURCE
23
 
# define _GNU_SOURCE    1
24
 
#endif
25
 
 
26
 
#include <errno.h>
 
26
# define _GNU_SOURCE    1
 
27
#endif
 
28
 
 
29
#if ! defined __builtin_expect && __GNUC__ < 3
 
30
# define __builtin_expect(expr, expected) (expr)
 
31
#endif
 
32
 
27
33
#include <fnmatch.h>
 
34
 
 
35
#include <alloca.h>
 
36
#include <assert.h>
28
37
#include <ctype.h>
29
 
 
30
 
#if defined STDC_HEADERS || !defined isascii
31
 
# define IN_CTYPE_DOMAIN(c) 1
32
 
#else
33
 
# define IN_CTYPE_DOMAIN(c) isascii (c)
34
 
#endif
35
 
 
36
 
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
37
 
 
38
 
 
39
 
#ifndef errno
40
 
extern int errno;
41
 
#endif
42
 
 
43
 
/* Match STRING against the filename pattern PATTERN, returning zero if
44
 
   it matches, nonzero if not.  */
 
38
#include <errno.h>
 
39
#include <stddef.h>
 
40
#include <stdbool.h>
 
41
#include <stdlib.h>
 
42
#include <string.h>
 
43
 
 
44
#define WIDE_CHAR_SUPPORT \
 
45
  (HAVE_WCTYPE_H && HAVE_BTOWC && HAVE_ISWCTYPE \
 
46
   && HAVE_WMEMCHR && (HAVE_WMEMCPY || HAVE_WMEMPCPY))
 
47
 
 
48
/* For platform which support the ISO C amendement 1 functionality we
 
49
   support user defined character classes.  */
 
50
#if defined _LIBC || WIDE_CHAR_SUPPORT
 
51
# include <wctype.h>
 
52
# include <wchar.h>
 
53
#endif
 
54
 
 
55
/* We need some of the locale data (the collation sequence information)
 
56
   but there is no interface to get this information in general.  Therefore
 
57
   we support a correct implementation only in glibc.  */
 
58
#ifdef _LIBC
 
59
# include "../locale/localeinfo.h"
 
60
# include "../locale/elem-hash.h"
 
61
# include "../locale/coll-lookup.h"
 
62
# include <shlib-compat.h>
 
63
 
 
64
# define CONCAT(a,b) __CONCAT(a,b)
 
65
# define mbsrtowcs __mbsrtowcs
 
66
# define fnmatch __fnmatch
 
67
extern int fnmatch (const char *pattern, const char *string, int flags);
 
68
#endif
 
69
 
 
70
#ifndef SIZE_MAX
 
71
# define SIZE_MAX ((size_t) -1)
 
72
#endif
 
73
 
 
74
/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set.  */
 
75
#define NO_LEADING_PERIOD(flags) \
 
76
  ((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD))
 
77
 
 
78
/* Comment out all this code if we are using the GNU C Library, and are not
 
79
   actually compiling the library itself, and have not detected a bug
 
80
   in the library.  This code is part of the GNU C
 
81
   Library, but also included in many other GNU distributions.  Compiling
 
82
   and linking in this code is a waste when using the GNU C library
 
83
   (especially if it is a shared library).  Rather than having every GNU
 
84
   program understand `configure --with-gnu-libc' and omit the object files,
 
85
   it is simpler to just do this in the source for each such file.  */
 
86
 
 
87
#if defined _LIBC || !defined __GNU_LIBRARY__ || !HAVE_FNMATCH_GNU
 
88
 
 
89
 
 
90
# if ! (defined isblank || (HAVE_ISBLANK && HAVE_DECL_ISBLANK))
 
91
#  define isblank(c) ((c) == ' ' || (c) == '\t')
 
92
# endif
 
93
 
 
94
# define STREQ(s1, s2) (strcmp (s1, s2) == 0)
 
95
 
 
96
# if defined _LIBC || WIDE_CHAR_SUPPORT
 
97
/* The GNU C library provides support for user-defined character classes
 
98
   and the functions from ISO C amendement 1.  */
 
99
#  ifdef CHARCLASS_NAME_MAX
 
100
#   define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
 
101
#  else
 
102
/* This shouldn't happen but some implementation might still have this
 
103
   problem.  Use a reasonable default value.  */
 
104
#   define CHAR_CLASS_MAX_LENGTH 256
 
105
#  endif
 
106
 
 
107
#  ifdef _LIBC
 
108
#   define IS_CHAR_CLASS(string) __wctype (string)
 
109
#  else
 
110
#   define IS_CHAR_CLASS(string) wctype (string)
 
111
#  endif
 
112
 
 
113
#  ifdef _LIBC
 
114
#   define ISWCTYPE(WC, WT)     __iswctype (WC, WT)
 
115
#  else
 
116
#   define ISWCTYPE(WC, WT)     iswctype (WC, WT)
 
117
#  endif
 
118
 
 
119
#  if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC
 
120
/* In this case we are implementing the multibyte character handling.  */
 
121
#   define HANDLE_MULTIBYTE     1
 
122
#  endif
 
123
 
 
124
# else
 
125
#  define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
 
126
 
 
127
#  define IS_CHAR_CLASS(string)                                               \
 
128
   (STREQ (string, "alpha") || STREQ (string, "upper")                        \
 
129
    || STREQ (string, "lower") || STREQ (string, "digit")                     \
 
130
    || STREQ (string, "alnum") || STREQ (string, "xdigit")                    \
 
131
    || STREQ (string, "space") || STREQ (string, "print")                     \
 
132
    || STREQ (string, "punct") || STREQ (string, "graph")                     \
 
133
    || STREQ (string, "cntrl") || STREQ (string, "blank"))
 
134
# endif
 
135
 
 
136
/* Avoid depending on library functions or files
 
137
   whose names are inconsistent.  */
 
138
 
 
139
/* Global variable.  */
 
140
static int posixly_correct;
 
141
 
 
142
# ifndef internal_function
 
143
/* Inside GNU libc we mark some function in a special way.  In other
 
144
   environments simply ignore the marking.  */
 
145
#  define internal_function
 
146
# endif
 
147
 
 
148
/* Note that this evaluates C many times.  */
 
149
# define FOLD(c) ((flags & FNM_CASEFOLD) ? tolower (c) : (c))
 
150
# define CHAR   char
 
151
# define UCHAR  unsigned char
 
152
# define INT    int
 
153
# define FCT    internal_fnmatch
 
154
# define EXT    ext_match
 
155
# define END    end_pattern
 
156
# define L_(CS) CS
 
157
# ifdef _LIBC
 
158
#  define BTOWC(C)      __btowc (C)
 
159
# else
 
160
#  define BTOWC(C)      btowc (C)
 
161
# endif
 
162
# define STRLEN(S) strlen (S)
 
163
# define STRCAT(D, S) strcat (D, S)
 
164
# ifdef _LIBC
 
165
#  define MEMPCPY(D, S, N) __mempcpy (D, S, N)
 
166
# else
 
167
#  if HAVE_MEMPCPY
 
168
#   define MEMPCPY(D, S, N) mempcpy (D, S, N)
 
169
#  else
 
170
#   define MEMPCPY(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
 
171
#  endif
 
172
# endif
 
173
# define MEMCHR(S, C, N) memchr (S, C, N)
 
174
# define STRCOLL(S1, S2) strcoll (S1, S2)
 
175
# include "fnmatch_loop.c"
 
176
 
 
177
 
 
178
# if HANDLE_MULTIBYTE
 
179
#  define FOLD(c) ((flags & FNM_CASEFOLD) ? towlower (c) : (c))
 
180
#  define CHAR  wchar_t
 
181
#  define UCHAR wint_t
 
182
#  define INT   wint_t
 
183
#  define FCT   internal_fnwmatch
 
184
#  define EXT   ext_wmatch
 
185
#  define END   end_wpattern
 
186
#  define L_(CS)        L##CS
 
187
#  define BTOWC(C)      (C)
 
188
#  ifdef _LIBC
 
189
#   define STRLEN(S) __wcslen (S)
 
190
#   define STRCAT(D, S) __wcscat (D, S)
 
191
#   define MEMPCPY(D, S, N) __wmempcpy (D, S, N)
 
192
#  else
 
193
#   define STRLEN(S) wcslen (S)
 
194
#   define STRCAT(D, S) wcscat (D, S)
 
195
#   if HAVE_WMEMPCPY
 
196
#    define MEMPCPY(D, S, N) wmempcpy (D, S, N)
 
197
#   else
 
198
#    define MEMPCPY(D, S, N) (wmemcpy (D, S, N) + (N))
 
199
#   endif
 
200
#  endif
 
201
#  define MEMCHR(S, C, N) wmemchr (S, C, N)
 
202
#  define STRCOLL(S1, S2) wcscoll (S1, S2)
 
203
#  define WIDE_CHAR_VERSION 1
 
204
 
 
205
#  undef IS_CHAR_CLASS
 
206
/* We have to convert the wide character string in a multibyte string.  But
 
207
   we know that the character class names consist of alphanumeric characters
 
208
   from the portable character set, and since the wide character encoding
 
209
   for a member of the portable character set is the same code point as
 
210
   its single-byte encoding, we can use a simplified method to convert the
 
211
   string to a multibyte character string.  */
 
212
static wctype_t
 
213
is_char_class (const wchar_t *wcs)
 
214
{
 
215
  char s[CHAR_CLASS_MAX_LENGTH + 1];
 
216
  char *cp = s;
 
217
 
 
218
  do
 
219
    {
 
220
      /* Test for a printable character from the portable character set.  */
 
221
#  ifdef _LIBC
 
222
      if (*wcs < 0x20 || *wcs > 0x7e
 
223
          || *wcs == 0x24 || *wcs == 0x40 || *wcs == 0x60)
 
224
        return (wctype_t) 0;
 
225
#  else
 
226
      switch (*wcs)
 
227
        {
 
228
        case L' ': case L'!': case L'"': case L'#': case L'%':
 
229
        case L'&': case L'\'': case L'(': case L')': case L'*':
 
230
        case L'+': case L',': case L'-': case L'.': case L'/':
 
231
        case L'0': case L'1': case L'2': case L'3': case L'4':
 
232
        case L'5': case L'6': case L'7': case L'8': case L'9':
 
233
        case L':': case L';': case L'<': case L'=': case L'>':
 
234
        case L'?':
 
235
        case L'A': case L'B': case L'C': case L'D': case L'E':
 
236
        case L'F': case L'G': case L'H': case L'I': case L'J':
 
237
        case L'K': case L'L': case L'M': case L'N': case L'O':
 
238
        case L'P': case L'Q': case L'R': case L'S': case L'T':
 
239
        case L'U': case L'V': case L'W': case L'X': case L'Y':
 
240
        case L'Z':
 
241
        case L'[': case L'\\': case L']': case L'^': case L'_':
 
242
        case L'a': case L'b': case L'c': case L'd': case L'e':
 
243
        case L'f': case L'g': case L'h': case L'i': case L'j':
 
244
        case L'k': case L'l': case L'm': case L'n': case L'o':
 
245
        case L'p': case L'q': case L'r': case L's': case L't':
 
246
        case L'u': case L'v': case L'w': case L'x': case L'y':
 
247
        case L'z': case L'{': case L'|': case L'}': case L'~':
 
248
          break;
 
249
        default:
 
250
          return (wctype_t) 0;
 
251
        }
 
252
#  endif
 
253
 
 
254
      /* Avoid overrunning the buffer.  */
 
255
      if (cp == s + CHAR_CLASS_MAX_LENGTH)
 
256
        return (wctype_t) 0;
 
257
 
 
258
      *cp++ = (char) *wcs++;
 
259
    }
 
260
  while (*wcs != L'\0');
 
261
 
 
262
  *cp = '\0';
 
263
 
 
264
#  ifdef _LIBC
 
265
  return __wctype (s);
 
266
#  else
 
267
  return wctype (s);
 
268
#  endif
 
269
}
 
270
#  define IS_CHAR_CLASS(string) is_char_class (string)
 
271
 
 
272
#  include "fnmatch_loop.c"
 
273
# endif
 
274
 
 
275
 
45
276
int
46
277
fnmatch (const char *pattern, const char *string, int flags)
47
278
{
48
 
  register const char *p = pattern, *n = string;
49
 
  register char c;
50
 
 
51
 
/* Note that this evaluates C many times.  */
52
 
#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \
53
 
                 ? tolower ((unsigned char) (c)) \
54
 
                 : (c))
55
 
 
56
 
  while ((c = *p++) != '\0')
 
279
# if HANDLE_MULTIBYTE
 
280
#  define ALLOCA_LIMIT 2000
 
281
  if (__builtin_expect (MB_CUR_MAX, 1) != 1)
57
282
    {
58
 
      c = FOLD (c);
59
 
 
60
 
      switch (c)
61
 
        {
62
 
        case '?':
63
 
          if (*n == '\0')
64
 
            return FNM_NOMATCH;
65
 
          else if ((flags & FNM_FILE_NAME) && *n == '/')
66
 
            return FNM_NOMATCH;
67
 
          else if ((flags & FNM_PERIOD) && *n == '.' &&
68
 
                   (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
69
 
            return FNM_NOMATCH;
70
 
          break;
71
 
 
72
 
        case '\\':
73
 
          if (!(flags & FNM_NOESCAPE))
74
 
            {
75
 
              c = *p++;
76
 
              if (c == '\0')
77
 
                /* Trailing \ loses.  */
78
 
                return FNM_NOMATCH;
79
 
              c = FOLD (c);
80
 
            }
81
 
          if (FOLD (*n) != c)
82
 
            return FNM_NOMATCH;
83
 
          break;
84
 
 
85
 
        case '*':
86
 
          if ((flags & FNM_PERIOD) && *n == '.' &&
87
 
              (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
88
 
            return FNM_NOMATCH;
89
 
 
90
 
          for (c = *p++; c == '?' || c == '*'; c = *p++)
91
 
            {
92
 
              if (c == '?')
93
 
                {
94
 
                  /* A ? needs to match one character.  */
95
 
                  if (*n == '\0' || (*n == '/' && (flags & FNM_FILE_NAME)))
96
 
                    /* There isn't another character; no match.  */
97
 
                    return FNM_NOMATCH;
98
 
                  else
99
 
                    /* One character of the string is consumed in matching
100
 
                       this ? wildcard, so *??? won't match if there are
101
 
                       less than three characters.  */
102
 
                    ++n;
103
 
                }
104
 
            }
105
 
 
106
 
          if (c == '\0')
107
 
            {
108
 
              if ((flags & (FNM_FILE_NAME | FNM_LEADING_DIR)) == FNM_FILE_NAME)
109
 
                for (; *n != '\0'; n++)
110
 
                  if (*n == '/')
111
 
                    return FNM_NOMATCH;
112
 
              return 0;
113
 
            }
114
 
 
115
 
          {
116
 
            char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
117
 
            c1 = FOLD (c1);
118
 
            for (--p; *n != '\0'; ++n)
119
 
              if ((c == '[' || FOLD (*n) == c1) &&
120
 
                  fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
121
 
                return 0;
122
 
              else if (*n == '/' && (flags & FNM_FILE_NAME))
123
 
                break;
124
 
            return FNM_NOMATCH;
125
 
          }
126
 
 
127
 
        case '[':
128
 
          {
129
 
            /* Nonzero if the sense of the character class is inverted.  */
130
 
            register int not;
131
 
 
132
 
            if (*n == '\0')
133
 
              return FNM_NOMATCH;
134
 
 
135
 
            if ((flags & FNM_PERIOD) && *n == '.' &&
136
 
                (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
137
 
              return FNM_NOMATCH;
138
 
 
139
 
            not = (*p == '!' || *p == '^');
140
 
            if (not)
141
 
              ++p;
142
 
 
143
 
            c = *p++;
144
 
            for (;;)
145
 
              {
146
 
                register char cstart = c, cend = c;
147
 
 
148
 
                if (!(flags & FNM_NOESCAPE) && c == '\\')
149
 
                  {
150
 
                    if (*p == '\0')
151
 
                      return FNM_NOMATCH;
152
 
                    cstart = cend = *p++;
153
 
                  }
154
 
 
155
 
                cstart = cend = FOLD (cstart);
156
 
 
157
 
                if (c == '\0')
158
 
                  /* [ (unterminated) loses.  */
159
 
                  return FNM_NOMATCH;
160
 
 
161
 
                c = *p++;
162
 
                c = FOLD (c);
163
 
 
164
 
                if ((flags & FNM_FILE_NAME) && c == '/')
165
 
                  /* [/] can never match.  */
166
 
                  return FNM_NOMATCH;
167
 
 
168
 
                if (c == '-' && *p != ']')
169
 
                  {
170
 
                    cend = *p++;
171
 
                    if (!(flags & FNM_NOESCAPE) && cend == '\\')
172
 
                      cend = *p++;
173
 
                    if (cend == '\0')
174
 
                      return FNM_NOMATCH;
175
 
                    cend = FOLD (cend);
176
 
 
177
 
                    c = *p++;
178
 
                  }
179
 
 
180
 
                if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
181
 
                  goto matched;
182
 
 
183
 
                if (c == ']')
184
 
                  break;
185
 
              }
186
 
            if (!not)
187
 
              return FNM_NOMATCH;
188
 
            break;
189
 
 
190
 
          matched:;
191
 
            /* Skip the rest of the [...] that already matched.  */
192
 
            while (c != ']')
193
 
              {
194
 
                if (c == '\0')
195
 
                  /* [... (unterminated) loses.  */
196
 
                  return FNM_NOMATCH;
197
 
 
198
 
                c = *p++;
199
 
                if (!(flags & FNM_NOESCAPE) && c == '\\')
200
 
                  {
201
 
                    if (*p == '\0')
202
 
                      return FNM_NOMATCH;
203
 
                    /* XXX 1003.2d11 is unclear if this is right.  */
204
 
                    ++p;
205
 
                  }
206
 
              }
207
 
            if (not)
208
 
              return FNM_NOMATCH;
209
 
          }
210
 
          break;
211
 
 
212
 
        default:
213
 
          if (c != FOLD (*n))
214
 
            return FNM_NOMATCH;
215
 
        }
216
 
 
217
 
      ++n;
 
283
      mbstate_t ps;
 
284
      size_t patsize;
 
285
      size_t strsize;
 
286
      size_t totsize;
 
287
      wchar_t *wpattern;
 
288
      wchar_t *wstring;
 
289
      int res;
 
290
 
 
291
      /* Calculate the size needed to convert the strings to
 
292
         wide characters.  */
 
293
      memset (&ps, '\0', sizeof (ps));
 
294
      patsize = mbsrtowcs (NULL, &pattern, 0, &ps) + 1;
 
295
      if (__builtin_expect (patsize != 0, 1))
 
296
        {
 
297
          assert (mbsinit (&ps));
 
298
          strsize = mbsrtowcs (NULL, &string, 0, &ps) + 1;
 
299
          if (__builtin_expect (strsize != 0, 1))
 
300
            {
 
301
              assert (mbsinit (&ps));
 
302
              totsize = patsize + strsize;
 
303
              if (__builtin_expect (! (patsize <= totsize
 
304
                                       && totsize <= SIZE_MAX / sizeof (wchar_t)),
 
305
                                    0))
 
306
                {
 
307
                  errno = ENOMEM;
 
308
                  return -1;
 
309
                }
 
310
 
 
311
              /* Allocate room for the wide characters.  */
 
312
              if (__builtin_expect (totsize < ALLOCA_LIMIT, 1))
 
313
                wpattern = (wchar_t *) alloca (totsize * sizeof (wchar_t));
 
314
              else
 
315
                {
 
316
                  wpattern = malloc (totsize * sizeof (wchar_t));
 
317
                  if (__builtin_expect (! wpattern, 0))
 
318
                    {
 
319
                      errno = ENOMEM;
 
320
                      return -1;
 
321
                    }
 
322
                }
 
323
              wstring = wpattern + patsize;
 
324
 
 
325
              /* Convert the strings into wide characters.  */
 
326
              mbsrtowcs (wpattern, &pattern, patsize, &ps);
 
327
              assert (mbsinit (&ps));
 
328
              mbsrtowcs (wstring, &string, strsize, &ps);
 
329
 
 
330
              res = internal_fnwmatch (wpattern, wstring, wstring + strsize - 1,
 
331
                                       flags & FNM_PERIOD, flags);
 
332
 
 
333
              if (__builtin_expect (! (totsize < ALLOCA_LIMIT), 0))
 
334
                free (wpattern);
 
335
              return res;
 
336
            }
 
337
        }
218
338
    }
219
339
 
220
 
  if (*n == '\0')
221
 
    return 0;
222
 
 
223
 
  if ((flags & FNM_LEADING_DIR) && *n == '/')
224
 
    /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz".  */
225
 
    return 0;
226
 
 
227
 
  return FNM_NOMATCH;
228
 
 
229
 
#undef FOLD
 
340
# endif /* HANDLE_MULTIBYTE */
 
341
 
 
342
  return internal_fnmatch (pattern, string, string + strlen (string),
 
343
                           flags & FNM_PERIOD, flags);
230
344
}
 
345
 
 
346
# ifdef _LIBC
 
347
#  undef fnmatch
 
348
versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3);
 
349
#  if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2_3)
 
350
strong_alias (__fnmatch, __fnmatch_old)
 
351
compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
 
352
#  endif
 
353
libc_hidden_ver (__fnmatch, fnmatch)
 
354
# endif
 
355
 
 
356
#endif  /* _LIBC or not __GNU_LIBRARY__.  */