From 2694fcbd4bf229d884e4197b89e86e8493eb14db Mon Sep 17 00:00:00 2001 From: dsl Date: Fri, 14 Mar 2008 22:21:53 +0000 Subject: [PATCH] Add a local strcasecmp() instead of pulling the bloat from libkern. --- sys/lib/libsa/dosfs.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/lib/libsa/dosfs.c b/sys/lib/libsa/dosfs.c index a8831c09fa77..879622921aff 100644 --- a/sys/lib/libsa/dosfs.c +++ b/sys/lib/libsa/dosfs.c @@ -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 */