From 64bc6412188b141c010ac3b8e813b837dd991e80 Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Sun, 14 May 2000 04:16:35 +0000 Subject: Initial revision --- libc/string/strncasecmp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 libc/string/strncasecmp.c (limited to 'libc/string/strncasecmp.c') diff --git a/libc/string/strncasecmp.c b/libc/string/strncasecmp.c new file mode 100644 index 000000000..561f72a76 --- /dev/null +++ b/libc/string/strncasecmp.c @@ -0,0 +1,28 @@ +/* Copyright (C) 1995,1996 Robert de Bath + * This file is part of the Linux-8086 C library and is distributed + * under the GNU Library General Public License. + */ + +#include +#include + +int +strncasecmp(s, d, l) +char *s; +char *d; +size_t l; +{ + while(l>0) + { + if( *s != *d ) + { + if( tolower(*s) != tolower(*d) ) + return *s - *d; + } + else + if( *s == '\0' ) return 0; + s++; d++; l--; + } + return 0; +} + -- cgit v1.2.3