version 1.21, 2006/02/22 00:04:44 |
version 1.21.2.1, 2006/09/30 04:06:50 |
|
|
|
/* $OpenBSD$ */ |
/* |
/* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
*/ |
|
|
#include "includes.h" |
#include <sys/types.h> |
RCSID("$OpenBSD$"); |
|
|
|
#include <ctype.h> |
#include <ctype.h> |
|
#include <string.h> |
|
|
#include "match.h" |
|
#include "xmalloc.h" |
#include "xmalloc.h" |
|
#include "match.h" |
|
|
/* |
/* |
* Returns true if the given string matches the pattern (which may contain ? |
* Returns true if the given string matches the pattern (which may contain ? |
|
|
i < len && subi < sizeof(sub) - 1 && pattern[i] != ','; |
i < len && subi < sizeof(sub) - 1 && pattern[i] != ','; |
subi++, i++) |
subi++, i++) |
sub[subi] = dolower && isupper(pattern[i]) ? |
sub[subi] = dolower && isupper(pattern[i]) ? |
tolower(pattern[i]) : pattern[i]; |
(char)tolower(pattern[i]) : pattern[i]; |
/* If subpattern too long, return failure (no match). */ |
/* If subpattern too long, return failure (no match). */ |
if (subi >= sizeof(sub) - 1) |
if (subi >= sizeof(sub) - 1) |
return 0; |
return 0; |