From f1d036ccba93c9e9d89dcbdae720887a630a35e5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 24 Sep 2017 16:35:44 +0200 Subject: Make serdi syntax options case-insensitive --- src/reader.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/reader.c') diff --git a/src/reader.c b/src/reader.c index 9e30f9c1..788d0a74 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1593,14 +1593,7 @@ tokcmp(SerdReader* reader, Ref ref, const char* tok, size_t n) if (!node || node->n_bytes != n) { return -1; } - const char* s1 = (const char*)node->buf; - const char* s2 = tok; - for (; n > 0 && *s2; s1++, s2++, --n) { - if (toupper(*s1) != toupper(*s2)) { - return ((*(uint8_t*)s1 < *(uint8_t*)s2) ? -1 : +1); - } - } - return 0; + return serd_strncasecmp((const char*)node->buf, tok, n); } static bool -- cgit v1.2.1