Skip to content

Commit

Permalink
once more
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Apr 6, 2016
1 parent 9ef370c commit ba1d9cf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion far/changelog
@@ -1,4 +1,8 @@
drkns 06.04.2016 22:42:14 +0200 - build 4616
drkns 06.04.2016 23:43:12 +0200 - build 4617

1. И ещё раз.

drkns 06.04.2016 22:42:14 +0200 - build 4616

1. Fix of fix of 4564.

Expand Down
6 changes: 5 additions & 1 deletion far/filelist.cpp
Expand Up @@ -7251,19 +7251,23 @@ void FileList::UpdatePlugin(int KeepSelection, int UpdateEvenIfPanelInvisible)

const auto IsTwoDots = (!TwoDotsPtr || !(TwoDotsPtr->FileAttr & FILE_ATTRIBUTE_DIRECTORY)) && TestParentFolderName(NewItem.strName);
const auto IsDir = (NewItem.FileAttr & FILE_ATTRIBUTE_DIRECTORY) != 0;
const auto Size = NewItem.FileSize;

m_ListData.emplace_back(std::move(NewItem));

if (IsTwoDots)
{
// We keep the address of the first encountered ".." element for special treatment.
// However, if we found a file and after that we fond a directory - it's better to pick a directory.
// However, if we found a file and after that we found a directory - it's better to pick a directory.
if (!TwoDotsPtr || (IsDir && !(TwoDotsPtr->FileAttr & FILE_ATTRIBUTE_DIRECTORY)))
{
// We reserve capacity so no reallocation will happen and pointer will stay valid.
TwoDotsPtr = &m_ListData.back();
}
}

IsDir? ++m_TotalDirCount : ++m_TotalFileCount;
TotalFileSize += Size;
}

if (!TwoDotsPtr)
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4616)m4_dnl
m4_define(BUILD,4617)m4_dnl

0 comments on commit ba1d9cf

Please sign in to comment.