Skip to content

Commit

Permalink
fix 5071 - oem cp by default
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Oct 25, 2017
1 parent da3ae09 commit d583d60
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
drkns 25.10.2017 19:02:49 +0100 - build 5073

1. Уточнение 5071 - OEM CP по умолчанию.

zg 25.10.2017 13:41:20 +0300 - build 5072

1. 0003524: FCTL_SETUSERSCREEN и диалоги.
Expand Down
17 changes: 12 additions & 5 deletions far/language.cpp
Expand Up @@ -62,17 +62,24 @@ std::tuple<os::fs::file, string, uintptr_t> OpenLangFile(const string& Path,cons
{
const auto CurrentFileName = PathWithSlash + FindData.strFileName;

std::get<0>(CurrentFileData) = os::fs::file(CurrentFileName, FILE_READ_DATA, FILE_SHARE_READ, nullptr, OPEN_EXISTING);
if (std::get<0>(CurrentFileData))
auto& CurrentFile = std::get<0>(CurrentFileData);
auto& CurrentLngName = std::get<1>(CurrentFileData);
auto& CurrentCodepage = std::get<2>(CurrentFileData);

CurrentFile = os::fs::file(CurrentFileName, FILE_READ_DATA, FILE_SHARE_READ, nullptr, OPEN_EXISTING);
if (CurrentFile)
{
GetFileFormat(std::get<0>(CurrentFileData), std::get<2>(CurrentFileData), nullptr, false);
// Default
CurrentCodepage = CP_OEMCP;

GetFileFormat(CurrentFile, CurrentCodepage, nullptr, false);

if (GetLangParam(std::get<0>(CurrentFileData), L"Language", std::get<1>(CurrentFileData), nullptr, std::get<2>(CurrentFileData)) && equal_icase(std::get<1>(CurrentFileData), Language))
if (GetLangParam(CurrentFile, L"Language", CurrentLngName, nullptr, CurrentCodepage) && equal_icase(CurrentLngName, Language))
{
return CurrentFileData;
}

if (equal_icase(std::get<1>(CurrentFileData), L"English"_sv))
if (equal_icase(CurrentLngName, L"English"_sv))
{
EnglishFileData = std::move(CurrentFileData);
}
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,5072)m4_dnl
m4_define(BUILD,5073)m4_dnl

0 comments on commit d583d60

Please sign in to comment.