Skip to content

Commit

Permalink
Fix the empty folders are excluded issue for the UFS/UFS2 file system…
Browse files Browse the repository at this point in the history
… image readonly support in NanaZip.Codecs.
  • Loading branch information
MouriNaruto committed Feb 1, 2025
1 parent 240e312 commit c70ee81
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion NanaZip.Codecs/NanaZip.Codecs.Archive.Ufs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,17 @@ namespace NanaZip::Codecs::Archive
return;
}

if (!RootPath.empty())
{
UfsFilePathInformation Current;
Current.Path = RootPath;
// Remove the slash.
Current.Path.resize(Current.Path.size() - 1);
Current.Inode = RootInode;
Current.Information = Information;
this->m_FilePaths.emplace_back(Current);
}

std::int32_t BlockSize = this->GetBlockSize();

std::size_t BlockOffsetsCount = Information.BlockOffsets.size();
Expand Down Expand Up @@ -780,6 +791,8 @@ namespace NanaZip::Codecs::Archive
OpenCallback->SetTotal(&TotalFiles, &TotalBytes);
}

this->m_FilePaths.clear();

this->GetAllPaths(UFS_ROOTINO, "");
TotalFiles = this->m_FilePaths.size();

Expand All @@ -788,7 +801,6 @@ namespace NanaZip::Codecs::Archive
OpenCallback->SetTotal(&TotalFiles, &TotalBytes);
}

this->m_FilePaths.clear();
for (auto const& Item : this->m_TemporaryFilePaths)
{
UfsFilePathInformation Current;
Expand Down

0 comments on commit c70ee81

Please sign in to comment.