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;