summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-23 21:23:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-23 21:23:20 +0000
commitbdb90bbd656fb1621485ed7f3218df1fe3e4e76d (patch)
tree814d28dd6af43c7ea8d3788ae9e627eab575b4fd
parentd8a81a7a63b37b760d5c22641ed4f4b1cfbb232a (diff)
checking the successful load
git-svn-id: http://svn.miranda-ng.org/main/trunk@8726 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/modules/langpack/langpack.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/modules/langpack/langpack.cpp b/src/modules/langpack/langpack.cpp
index 9d6f1fc914..b0beb9c673 100644
--- a/src/modules/langpack/langpack.cpp
+++ b/src/modules/langpack/langpack.cpp
@@ -107,10 +107,9 @@ void Langpack_LoadLangpack(void)
lstrcat(szSearch, langpack);
DWORD dwAttrib = GetFileAttributes(szSearch);
- if (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) {
- LoadLangPack(szSearch);
- return;
- }
+ if (dwAttrib != INVALID_FILE_ATTRIBUTES && !(dwAttrib & FILE_ATTRIBUTE_DIRECTORY))
+ if (!LoadLangPack(szSearch))
+ return;
}
// look into mirandaboot.ini
@@ -118,8 +117,8 @@ void Langpack_LoadLangpack(void)
if (GetPrivateProfileString(_T("Language"), _T("DefaultLanguage"), _T(""), tszDefaultLang, SIZEOF(tszDefaultLang), mirandabootini)) {
TCHAR tszLangPath[MAX_PATH];
PathToAbsoluteT(tszDefaultLang, tszLangPath);
- LoadLangPack(tszLangPath);
- return;
+ if (!LoadLangPack(tszLangPath))
+ return;
}
// finally try to load first file
@@ -134,10 +133,12 @@ void Langpack_LoadLangpack(void)
/* load langpack */
PathToAbsoluteT(_T("\\"), szSearch);
lstrcat(szSearch, fd.cFileName);
- if (!LoadLangPack(szSearch))
+ if (!LoadLangPack(szSearch)) {
db_set_ws(NULL, "Langpack", "Current", fd.cFileName);
- break;
- } while (FindNextFile(hFind, &fd));
+ break;
+ }
+ }
+ while (FindNextFile(hFind, &fd));
FindClose(hFind);
}
}