feat: do not set time for sole folder in extraction

This commit is contained in:
shunf4
2024-05-10 15:52:53 +08:00
parent fabeab4a9f
commit 76db359120
9 changed files with 40 additions and 6 deletions

View File

@@ -275,7 +275,8 @@ CArchiveExtractCallback::CArchiveExtractCallback():
Write_CTime(true),
Write_ATime(true),
Write_MTime(true),
_multiArchives(false)
_multiArchives(false),
SoleFolderIndex(-1LL)
{
LocalProgressSpec = new CLocalProgress();
_localProgress = LocalProgressSpec;
@@ -378,6 +379,8 @@ void CArchiveExtractCallback::Init(
NDir::MyGetFullPathName(directoryPath, _dirPathPrefix_Full);
NName::NormalizeDirPathPrefix(_dirPathPrefix_Full);
}
SoleFolderIndex = -1LL;
}
@@ -1142,7 +1145,7 @@ void CArchiveExtractCallback::CreateFolders()
CDirPathTime pt;
GetFiTimesCAM(pt);
if (pt.IsSomeTimeDefined())
if (pt.IsSomeTimeDefined() && _index != SoleFolderIndex)
{
pt.Path = fullPathNew;
pt.SetDirTime();

View File

@@ -455,6 +455,7 @@ public:
#endif
_keepAndReplaceEmptyDirPrefixes = keepAndReplaceEmptyDirPrefixes;
NumFolders = NumFiles = NumAltStreams = UnpackSize = AltStreams_UnpackSize = 0;
SoleFolderIndex = -1LL;
}
#ifndef Z7_SFX