e54849bfa18cf2d554321e8b6c24d957bf8bfde0
1 /* $Id: Pattern.cpp,v 1.2 2001/01/13 23:54:40 narnaoud Exp $
3 * regexpl - Console Registry Explorer
5 * Copyright (C) 2000,2001 Nedko Arnaoudov <nedkohome@atia.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; see the file COPYING. If not, write to
19 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 // Pattern.cpp: implementation of pattern functions
27 // based on wstrcmpjoki() by Jason Filby (jasonfilby@yahoo.com)
28 // reactos kernel, services/fs/vfat/string.c
29 BOOL
PatternMatch(const TCHAR
*pszPattern
, const TCHAR
*pszTry
)
31 while ((*pszPattern
== _T('?'))||((_totlower(*pszTry
)) == (_totlower(*pszPattern
))))
33 if (((*pszTry
) == 0) && ((*pszPattern
) == 0))
36 if (((*pszTry
) == 0) || ((*pszPattern
) == 0))
43 if (*pszPattern
== _T('*'))
48 if (PatternMatch(pszPattern
,pszTry
))
55 if (((*pszTry
) == 0) && ((*pszPattern
) == 0))