From 76ebeedbcf0c88950d8a862a9c05cfa9026a6066 Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Mon, 23 Jan 2017 13:58:08 +0000 Subject: [PATCH] Remove in-house implementations of strcasecmp and strncasecmp Issue: #325 --- strcasecmp.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 strcasecmp.c diff --git a/strcasecmp.c b/strcasecmp.c deleted file mode 100644 index 51e6e101f..000000000 --- a/strcasecmp.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include - -/* UnixWare doesn't have these functions in its standard C library */ - -int strncasecmp (char *s1, char *s2, size_t n) -{ - register int c1, c2, l = 0; - - while (*s1 && *s2 && l < n) - { - c1 = tolower ((unsigned char) *s1); - c2 = tolower ((unsigned char) *s2); - if (c1 != c2) - return (c1 - c2); - s1++; - s2++; - l++; - } - if (l == n) - return (int) (0); - else - return (int) (*s1 - *s2); -} - -int strcasecmp (char *s1, char *s2) -{ - register int c1, c2; - - while (*s1 && *s2) - { - c1 = tolower ((unsigned char) *s1); - c2 = tolower ((unsigned char) *s2); - if (c1 != c2) - return (c1 - c2); - s1++; - s2++; - } - return (int) (*s1 - *s2); -} -- 2.40.0