Add a local strcasecmp() instead of pulling the bloat from libkern.

This commit is contained in:
dsl 2008-03-14 22:21:53 +00:00
parent d293cfca1a
commit 2694fcbd4b
1 changed files with 18 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dosfs.c,v 1.12 2007/11/24 13:20:55 isaki Exp $ */
/* $NetBSD: dosfs.c,v 1.13 2008/03/14 22:21:53 dsl Exp $ */
/*
* Copyright (c) 1996, 1998 Robert Nordier
@ -150,6 +150,23 @@ static int ioread(DOS_FS *, u_int, void *, u_int);
static int iobuf(DOS_FS *, u_int);
static int ioget(struct open_file *, u_int, void *, u_int);
#define strcasecmp(s1, s2) dos_strcasecmp(s1, s2)
static int
strcasecmp(const char *s1, const char *s2)
{
char c1, c2;
#define TO_UPPER(c) ((c) >= 'a' && (c) <= 'z' ? (c) - ('a' - 'A') : (c))
for (;;) {
c1 = *s1++;
c2 = *s2++;
if (TO_UPPER(c1) != TO_UPPER(c2))
return 1;
if (c1 == 0)
return 0;
}
#undef TO_UPPER
}
/*
* Mount DOS filesystem
*/