Skip to content

Commit

Permalink
wrong tmp file deleted in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Mar 13, 2017
1 parent 827f576 commit 6da9f4a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
drkns 13.03.2017 13:39:47 +0000 - build 4914

1. С форума: Удаляется архив, содержащий другой архив

drkns 11.03.2017 00:05:34 +0000 - build 4913

1. С форума: съехал вправо заголовок окна справки.
Expand Down
10 changes: 7 additions & 3 deletions far/filelist.cpp
Expand Up @@ -2639,7 +2639,8 @@ void FileList::ProcessEnter(bool EnableExec,bool SeparateWindow,bool EnableAssoc
{
plugin_panel* OpenedPlugin = nullptr;
const auto PluginMode = m_PanelMode == panel_mode::PLUGIN_PANEL && !Global->CtrlObject->Plugins->UseFarCommand(m_hPlugin, PLUGIN_FARGETFILE);
SCOPE_EXIT{ if (PluginMode && (!OpenedPlugin || OpenedPlugin == PANEL_STOP)) DeleteFileWithFolder(strFileName); };
string FileNameToDelete;
SCOPE_EXIT{ if (PluginMode && (!OpenedPlugin || OpenedPlugin == PANEL_STOP) && !FileNameToDelete.empty()) DeleteFileWithFolder(FileNameToDelete); };
file_state SavedState;

if (PluginMode)
Expand All @@ -2653,8 +2654,11 @@ void FileList::ProcessEnter(bool EnableExec,bool SeparateWindow,bool EnableAssoc
FileListToPluginItem(CurItem, PanelItem);

if (!Global->CtrlObject->Plugins->GetFile(m_hPlugin, &PanelItem.Item, strTempDir, strFileName, OPM_SILENT | OPM_EDIT))
{
os::RemoveDirectory(strTempDir);
return;

}
FileNameToDelete = strFileName;
strShortFileName = ConvertNameToShort(strFileName);
SavedState = file_state::get(strFileName);
}
Expand Down Expand Up @@ -2703,7 +2707,7 @@ void FileList::ProcessEnter(bool EnableExec,bool SeparateWindow,bool EnableAssoc
if (EnableAssoc && ProcessLocalFileTypes(strFileName, strShortFileName, FILETYPE_ALTEXEC, PluginMode))
return;

OpenFilePlugin(strFileName, TRUE, Type);
OpenedPlugin = OpenFilePlugin(strFileName, TRUE, Type);
}

if (PluginMode && (!OpenedPlugin || OpenedPlugin == PANEL_STOP))
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4913)m4_dnl
m4_define(BUILD,4914)m4_dnl

0 comments on commit 6da9f4a

Please sign in to comment.