1 /* strmatch.c -- ksh-like extended pattern matching for the shell and filename
4 /* Copyright (C) 1991-2002 Free Software Foundation, Inc.
6 This file is part of GNU Bash, the Bourne Again SHell.
8 Bash is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later
13 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License along
19 with Bash; see the file COPYING. If not, write to the Free Software
20 Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
27 extern int xstrmatch __P((char *, char *, int));
28 #if defined (HAVE_MULTIBYTE)
29 extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
33 strmatch (pattern, string, flags)
38 if (string == 0 || pattern == 0)
41 return (xstrmatch (pattern, string, flags));
44 #if defined (HANDLE_MULTIBYTE)
46 wcsmatch (wpattern, wstring, flags)
51 if (wstring == 0 || wpattern == 0)
54 return (internal_wstrmatch (wpattern, wstring, flags));
68 if (strmatch (pat, string, 0) == 0)
70 printf ("%s matches %s\n", string, pat);
75 printf ("%s does not match %s\n", string, pat);