diff --git a/far/changelog b/far/changelog index f349f69613..affefffb79 100644 --- a/far/changelog +++ b/far/changelog @@ -1,4 +1,8 @@ -w17 03.02.2016 17:48:03 +0300 - build 4538 +drkns 03.02.2016 19:25:05 +0200 - build 4539 + +1. Передвинем хак для M#2922 в более подходящее место и упростим его. + +w17 03.02.2016 17:48:03 +0300 - build 4538 1. Уточнение 4537. diff --git a/far/execute.cpp b/far/execute.cpp index 9ab82ab324..749bf8a4b3 100644 --- a/far/execute.cpp +++ b/far/execute.cpp @@ -702,11 +702,6 @@ bool Execute(execute_info& Info, bool FolderRun, bool Silent, const std::functio } const auto strComspec(os::env::get_variable(L"COMSPEC")); - if (strComspec.empty() && !Info.DirectRun) - { - Message(MSG_WARNING, 1, MSG(MError), MSG(MComspecNotFound), MSG(MOk)); - return false; - } DWORD dwSubSystem = IMAGE_SUBSYSTEM_UNKNOWN; os::handle Process; @@ -810,6 +805,18 @@ bool Execute(execute_info& Info, bool FolderRun, bool Silent, const std::functio string ComSpecParams(Global->Opt->Exec.strComSpecParams); ComSpecParams += L" "; + + // ShellExecuteEx Win8.1+ wrongly opens symlinks in the separate console window + // Workaround: execute through %comspec% + if (Info.DirectRun && !Info.NewWindow && IsWindows8Point1OrGreater()) + { + os::fs::file_status fstatus(strNewCmdStr); + if (os::fs::is_file(fstatus) && fstatus.check(FILE_ATTRIBUTE_REPARSE_POINT)) + { + Info.DirectRun = false; + } + } + if (Info.DirectRun) { seInfo.lpFile = strNewCmdStr.data(); @@ -826,6 +833,12 @@ bool Execute(execute_info& Info, bool FolderRun, bool Silent, const std::functio } else { + if (strComspec.empty()) + { + Message(MSG_WARNING, 1, MSG(MError), MSG(MComspecNotFound), MSG(MOk)); + return false; + } + std::vector NotQuotedShellList; split(NotQuotedShellList, os::env::expand_strings(Global->Opt->Exec.strNotQuotedShell), STLF_UNIQUE); bool bQuotedShell = !(std::any_of(CONST_RANGE(NotQuotedShellList, i) { return !StrCmpI(i,PointToName(strComspec.data())); })); @@ -874,27 +887,6 @@ bool Execute(execute_info& Info, bool FolderRun, bool Silent, const std::functio } } - // ShellExecuteEx Win8.1+ wrongly opens symlinks in the separate console window - // Workaround: cmd /c Syslink.exe - string strParams; - if (seInfo.nShow == SW_SHOWNORMAL && !Info.NewWindow && IsWindows8Point1OrGreater()) - { - if (seInfo.lpFile && seInfo.lpVerb && wcscmp(seInfo.lpVerb, L"open") == 0 && !strComspec.empty()) - { - os::fs::file_status fstatus(seInfo.lpFile); - if (os::fs::is_file(fstatus) && fstatus.check(FILE_ATTRIBUTE_REPARSE_POINT)) - { - string fname(seInfo.lpFile); - strParams = ComSpecParams + L" " + QuoteSpace(fname); - if (seInfo.lpParameters && seInfo.lpParameters[0]) - strParams += string(L" ") + seInfo.lpParameters; - - seInfo.lpFile = strComspec.data(); - seInfo.lpParameters = strParams.data(); - } - } - } - Result = ShellExecuteEx(&seInfo) != FALSE; if (Result) diff --git a/far/vbuild.m4 b/far/vbuild.m4 index b50d3da086..73589558a6 100644 --- a/far/vbuild.m4 +++ b/far/vbuild.m4 @@ -1 +1 @@ -m4_define(BUILD,4538)m4_dnl +m4_define(BUILD,4539)m4_dnl