From 2068cf47f49397ba35a5501c7949a1c3ce6342ff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 9 Apr 2014 12:56:57 +0000 Subject: fixes #647 (built-in langpack doesn't work in the presence of another langpacks) git-svn-id: http://svn.miranda-ng.org/main/trunk@8902 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/langpack.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mir_core') diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index 5f1e0709fe..b362dc34e3 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -373,11 +373,6 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) } else _tcsncpy_s(tszFullPath, SIZEOF(tszFullPath), ptszLangPack, _TRUNCATE); - // exists & not a directory? - DWORD dwAttrib = GetFileAttributes(tszFullPath); - if (dwAttrib == INVALID_FILE_ATTRIBUTES || (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) - return 3; - // this lang is already loaded? nothing to do then if (!lstrcmp(tszFullPath, langPack.tszFullPath)) return 0; @@ -386,6 +381,11 @@ MIR_CORE_DLL(int) LoadLangPack(const TCHAR *ptszLangPack) if (g_entryCount) UnloadLangPackModule(); + // exists & not a directory? + DWORD dwAttrib = GetFileAttributes(tszFullPath); + if (dwAttrib == INVALID_FILE_ATTRIBUTES || (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) + return 3; + // copy the full file name and extract a file name from it _tcsncpy_s(langPack.tszFullPath, SIZEOF(langPack.tszFullPath), tszFullPath, _TRUNCATE); TCHAR *p = _tcsrchr(langPack.tszFullPath, '\\'); -- cgit v1.2.3