Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2016-10-05 03:00:00 +0300
committerKornel Lesiński <kornel@geekhood.net>2016-12-08 15:13:50 +0300
commit603abd5528c97346e9448c0ff47949f818fe558c (patch)
tree6603230f4eab118fc83554731dc86e30578ccff9 /CPP/7zip/Archive
parent232ce7957441b06193c4cbdc1bc9e71436fadfdb (diff)
16.0416.04
Diffstat (limited to 'CPP/7zip/Archive')
-rw-r--r--CPP/7zip/Archive/Rar/Rar5Handler.cpp19
-rw-r--r--CPP/7zip/Archive/Rar/Rar5Handler.h4
2 files changed, 21 insertions, 2 deletions
diff --git a/CPP/7zip/Archive/Rar/Rar5Handler.cpp b/CPP/7zip/Archive/Rar/Rar5Handler.cpp
index 4fb63505..d70a5686 100644
--- a/CPP/7zip/Archive/Rar/Rar5Handler.cpp
+++ b/CPP/7zip/Archive/Rar/Rar5Handler.cpp
@@ -231,6 +231,18 @@ bool CItem::Is_CopyLink() const
return FindExtra_Link(link) && link.Type == NLinkType::kFileCopy;
}
+bool CItem::Is_HardLink() const
+{
+ CLinkInfo link;
+ return FindExtra_Link(link) && link.Type == NLinkType::kHardLink;
+}
+
+bool CItem::Is_CopyLink_or_HardLink() const
+{
+ CLinkInfo link;
+ return FindExtra_Link(link) && (link.Type == NLinkType::kFileCopy || link.Type == NLinkType::kHardLink);
+}
+
void CItem::Link_to_Prop(unsigned linkType, NWindows::NCOM::CPropVariant &prop) const
{
CLinkInfo link;
@@ -2587,7 +2599,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
{
if (testMode)
{
- if (item->Is_CopyLink() && item->PackSize == 0)
+ if (item->NeedUse_as_CopyLink_or_HardLink())
{
RINOK(extractCallback->PrepareOperation(askMode));
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK));
@@ -2599,6 +2611,9 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
if (item->IsService())
continue;
+ if (item->NeedUse_as_HardLink())
+ continue;
+
bool needDecode = false;
for (unsigned n = i + 1; n < _refs.Size(); n++)
@@ -2639,7 +2654,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
continue;
}
- if (item->Is_CopyLink() && item->PackSize == 0)
+ if (item->NeedUse_as_CopyLink())
{
RINOK(extractCallback->SetOperationResult(
realOutStream ?
diff --git a/CPP/7zip/Archive/Rar/Rar5Handler.h b/CPP/7zip/Archive/Rar/Rar5Handler.h
index cf741c7c..27e937de 100644
--- a/CPP/7zip/Archive/Rar/Rar5Handler.h
+++ b/CPP/7zip/Archive/Rar/Rar5Handler.h
@@ -262,8 +262,12 @@ struct CItem
bool FindExtra_Link(CLinkInfo &link) const;
void Link_to_Prop(unsigned linkType, NWindows::NCOM::CPropVariant &prop) const;
bool Is_CopyLink() const;
+ bool Is_HardLink() const;
+ bool Is_CopyLink_or_HardLink() const;
bool NeedUse_as_CopyLink() const { return PackSize == 0 && Is_CopyLink(); }
+ bool NeedUse_as_HardLink() const { return PackSize == 0 && Is_HardLink(); }
+ bool NeedUse_as_CopyLink_or_HardLink() const { return PackSize == 0 && Is_CopyLink_or_HardLink(); }
bool GetAltStreamName(AString &name) const;