Navigation Menu

Skip to content

Commit

Permalink
fix 5038
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Sep 25, 2017
1 parent fa952cd commit de6c748
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
drkns 25.09.2017 20:22:04 +0100 - build 5044

1. Уточнение 5038.

drkns 25.09.2017 19:57:02 +0100 - build 5043

1. Уточнение 5041.
Expand Down
17 changes: 16 additions & 1 deletion far/execute.cpp
Expand Up @@ -180,7 +180,7 @@ static bool FindObject(const string& Module, string &strDest, bool &Internal)
return false;

const auto ModuleExt = PointToExt(Module);
const auto strPathExt = os::env::get_pathext();
const auto strPathExt = lower(os::env::get_pathext());
const auto PathExtList = enum_tokens(strPathExt, L";");

const auto& TryWithExtOrPathExt = [&](const string& Name, const auto& Predicate)
Expand Down Expand Up @@ -284,6 +284,21 @@ static bool FindObject(const string& Module, string &strDest, bool &Internal)
}
}

{
// Use SearchPath:
const auto Result = TryWithExtOrPathExt(Module, [](const string& NameWithExt)
{
string Result;
return std::make_pair(os::SearchPath(nullptr, NameWithExt, nullptr, Result), Result);
});

if (Result.first)
{
strDest = Result.second;
return true;
}
}

{
// Look in the App Paths registry keys:
if (Global->Opt->Exec.ExecuteUseAppPath && !contains(Module, L'\\'))
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,5043)m4_dnl
m4_define(BUILD,5044)m4_dnl

0 comments on commit de6c748

Please sign in to comment.