From cba375916fb18db8b9101aedf4fa079e019311b3 Mon Sep 17 00:00:00 2001 From: Igor Pavlov Date: Sun, 16 Aug 2015 00:00:00 +0000 Subject: 15.06 --- CPP/7zip/UI/Agent/AgentOut.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'CPP/7zip/UI/Agent') diff --git a/CPP/7zip/UI/Agent/AgentOut.cpp b/CPP/7zip/UI/Agent/AgentOut.cpp index 3fed8cba..0468fdd1 100644 --- a/CPP/7zip/UI/Agent/AgentOut.cpp +++ b/CPP/7zip/UI/Agent/AgentOut.cpp @@ -380,6 +380,21 @@ STDMETHODIMP CAgent::DoOperation( HRESULT res = outArchive->UpdateItems(outArchiveStream, updatePairs2.Size(), updateCallback); if (res == S_OK && processedPaths) { + { + /* OutHandler for 7z archives doesn't report compression operation for empty files. + So we must include these files manually */ + FOR_VECTOR(i, updatePairs2) + { + const CUpdatePair2 &up = updatePairs2[i]; + if (up.DirIndex >= 0 && up.NewData) + { + const CDirItem &di = dirItems.Items[up.DirIndex]; + if (!di.IsDir() && di.Size == 0) + processedItems[up.DirIndex] = 1; + } + } + } + FOR_VECTOR (i, dirItems.Items) if (processedItems[i] != 0) processedPaths->Add(dirItems.GetPhyPath(i)); -- cgit v1.2.3