diff options
author | Mattias Andrée <maandree@kth.se> | 2017-11-12 16:16:33 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2017-11-12 16:16:33 +0100 |
commit | 8cef2ca2598cfd0587faf29d0025d68c7dc598ea (patch) | |
tree | ee4737fed27a213869eb5ca005194cadf24b9cd2 /strcaseends.c | |
parent | Split into multiple units (diff) | |
download | libsimple-8cef2ca2598cfd0587faf29d0025d68c7dc598ea.tar.gz libsimple-8cef2ca2598cfd0587faf29d0025d68c7dc598ea.tar.bz2 libsimple-8cef2ca2598cfd0587faf29d0025d68c7dc598ea.tar.xz |
m + add readme
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-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); +} |