summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-02 21:28:41 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-02 21:28:41 +0200
commit897bb00af12ac069a8c1fc717ee40e9333329b48 (patch)
tree06766f3a7640e6672a65b0053af673b3ef6b7b4c /common.c
parenta6782e5e60427d32ef8aecc5179c5b34fc5dcbb5 (diff)
downloadxK-897bb00af12ac069a8c1fc717ee40e9333329b48.tar.gz
xK-897bb00af12ac069a8c1fc717ee40e9333329b48.tar.xz
xK-897bb00af12ac069a8c1fc717ee40e9333329b48.zip
degesch: add & use strncasecmp_ascii()
Diffstat (limited to 'common.c')
-rw-r--r--common.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/common.c b/common.c
index ce9e80f..52e737a 100644
--- a/common.c
+++ b/common.c
@@ -70,6 +70,17 @@ str_vector_find (const struct str_vector *v, const char *s)
return -1;
}
+static int
+strncasecmp_ascii (const char *a, const char *b, size_t n)
+{
+ int x;
+ while (n-- && (*a || *b))
+ if ((x = tolower_ascii (*(const unsigned char *) a++)
+ - tolower_ascii (*(const unsigned char *) b++)))
+ return x;
+ return 0;
+}
+
// --- Logging -----------------------------------------------------------------
static void