DEADSOFTWARE

build: remove old cp866 references from CMakeLists
[flatwaifu.git] / src / config.c
index dccf37c813c9708cfb759b8b5dcb2ae962668d14..86b6d227c96893cbc7cde91cdc83ca5c31a7f406 100644 (file)
@@ -23,6 +23,8 @@
 #include "files.h"
 #include "input.h"
 
+#include "common/cp866.h"
+
 static FILE *f;
 static int ch;
 
@@ -30,7 +32,7 @@ const cfg_t *CFG_find_entry (const char *key, const cfg_t *cfg) {
   assert(key != NULL);
   if (cfg != NULL) {
     int i = 0;
-    while (cfg[i].cfg && strcasecmp(cfg[i].cfg, key) != 0) {
+    while (cfg[i].cfg && cp866_strcasecmp(cfg[i].cfg, key) != 0) {
       i++;
     }
     return cfg[i].cfg ? &cfg[i] : NULL;
@@ -50,8 +52,8 @@ int CFG_update_key (const char *key, const char *value, const cfg_t *cfg) {
       case Y_WORD: *(word*)p = atoi(value); break;
       case Y_DWORD: *(dword*)p = atoi(value); break;
       case Y_STRING: strcpy(p, value); break; // TODO fix this security problem
-      case Y_SW_ON: *(byte*)p = strcasecmp(value, "on") == 0 ? 1 : 0; break;
-      case Y_SW_OFF: *(byte*)p = strcasecmp(value, "off") == 0 ? 1 : 0; break;
+      case Y_SW_ON: *(byte*)p = cp866_strcasecmp(value, "on") == 0 ? 1 : 0; break;
+      case Y_SW_OFF: *(byte*)p = cp866_strcasecmp(value, "off") == 0 ? 1 : 0; break;
       case Y_FILES: F_addwad(value); break;
       case Y_KEY: *(int*)p = I_string_to_key(value); break;
       default: assert(0); // unknown type -> something broken