Commit a8acc2ff5cd7eb4e2501f2ef529b1d8f21471f37

Adrian Perez de Castro 2019-08-05T15:59:20

Use built-in istr[n]cmp() instead of strcase[n]cmp() This avoids the problem that MSVC does not provide strcasecmp() nor strncasecmp(), and at the same time avoids potential problems due to locale configuration by using istrcmp() and istrncmp() which are already in the source tree and written to cover only ASCII.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/keysym.c b/src/keysym.c
index 7fc13b4..6c7975e 100644
--- a/src/keysym.c
+++ b/src/keysym.c
@@ -203,7 +203,7 @@ xkb_keysym_from_name(const char *s, enum xkb_keysym_flags flags)
      * no separating underscore, while some XF86* syms in the latter did.
      * As a last ditch effort, try without. */
     if (strncmp(s, "XF86_", 5) == 0 ||
-        (icase && strncasecmp(s, "XF86_", 5) == 0)) {
+        (icase && istrncmp(s, "XF86_", 5) == 0)) {
         xkb_keysym_t ret;
         tmp = strdup(s);
         if (!tmp)