diff options
Diffstat (limited to 'strcaseends.c')
-rw-r--r-- | strcaseends.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/strcaseends.c b/strcaseends.c new file mode 100644 index 0000000..a672b0a --- /dev/null +++ b/strcaseends.c @@ -0,0 +1,13 @@ +/* See LICENSE file for copyright and license details. */ +#include "libsimple.h" + + +int +libsimple_strcaseends(const char *s, const char *t) +{ + size_t sn = strlen(s); + size_t tn = strlen(t); + if (tn > sn) + return 0; + return !strcasecmp(&s[sn - tn], t); +} |