2 * Copyright (c) 2020 Proofpoint, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
12 #include <sm/sendmail.h>
15 #include <sm/string.h>
20 ** SM_STRCASEEQ -- are two strings equal (case-insensitive)?
43 return (sm_strcasecmp(s1, s2) == 0);
47 l1 = sm_lowercase(s1);
55 l2 = sm_lowercase(s2);
57 while (*l1 == *l2 && '\0' != *l1)
66 ** SM_STRNCASEEQ -- are two strings (up to a length) equal (case-insensitive)?
71 ** n -- maximum length to compare
74 ** true iff s1 == s2 (for up to the first n char)
78 sm_strncaseeq(s1, s2, n)
91 if (!asciinstr(s2, n))
93 return (sm_strncasecmp(s1, s2, n) == 0);
97 l1 = sm_lowercase(s1);
100 f1 = sm_strdup_x(l1);
105 l2 = sm_lowercase(s2);
107 while (*l1 == *l2 && '\0' != *l1 && --n > 0)