From e8a6bf5e61793d5d7dd73b631b2c6f96c02bc887 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Fri, 3 Feb 2023 12:01:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlinux=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=AF=B9=E6=AF=94BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_language.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app_language.cpp b/app_language.cpp index 3f39929..798f6e5 100644 --- a/app_language.cpp +++ b/app_language.cpp @@ -9,7 +9,7 @@ #else #include // for strcasecmp #define PATH_SEPERATOR "/" -#define THIS_MODULE_NAME "lang.so" +#define THIS_MODULE_NAME "liblang.so" #endif #include @@ -281,6 +281,7 @@ class lang_mgr cur_id = get_cur_code_page_id(); if (parse_pak_digest((uint8_t*)&cont[0], ms, (int*)&id)) { + ret = true; if (id == DEFAULT_CODE_PAGE) cp_default_ = ms; else @@ -367,7 +368,7 @@ class lang_mgr char path[512] = { 0 }; int len = readlink(lnk, path, sizeof(path) - 1); - return path; + return len > 0 ? path : lnk; } static bool found_module(const char* file, void* param) { @@ -442,8 +443,8 @@ class lang_mgr } else { - char* ext = strrchr(ent->d_name, '.'); - if (ext && strcasecmp(ext, ".pak") == 0) + //char* ext = strrchr(ent->d_name, '.'); + //if (ext && strcasecmp(ext, ".pak") == 0) { std::string file(dir); @@ -463,6 +464,10 @@ class lang_mgr } static bool found_language_pak(const char* file, void* obj) { +#if !defined(_WIN32) && !defined(_WIN64) + const char* ext = strrchr(file, '.'); + if (ext && strcasecmp(ext, ".pak") == 0) +#endif ((lang_mgr*)obj)->load_language_pak(file, true); return true;