diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2015-12-31 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:58 +0300 |
commit | 9608215ad8deb58355bae27692669fda067c4f43 (patch) | |
tree | 1227131a3f19bc36e5da4ba11791154d05cc08af /CPP/7zip/Archive/ComHandler.cpp | |
parent | 5de23c1deb52b8be4c43ad9f694c64bbddd0c38a (diff) |
15.1315.13
Diffstat (limited to 'CPP/7zip/Archive/ComHandler.cpp')
-rw-r--r-- | CPP/7zip/Archive/ComHandler.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/CPP/7zip/Archive/ComHandler.cpp b/CPP/7zip/Archive/ComHandler.cpp index 3a4834cd..e39dbab5 100644 --- a/CPP/7zip/Archive/ComHandler.cpp +++ b/CPP/7zip/Archive/ComHandler.cpp @@ -571,6 +571,7 @@ HRESULT CDatabase::Open(IInStream *inStream) RINOK(AddNode(-1, root.SonDid)); unsigned numCabs = 0; + FOR_VECTOR (i, Refs) { const CItem &item = Items[Refs[i].Did]; @@ -578,16 +579,20 @@ HRESULT CDatabase::Open(IInStream *inStream) continue; bool isMsiName; UString msiName = ConvertName(item.Name, isMsiName); - if (isMsiName) + if (isMsiName && !msiName.IsEmpty()) { + bool isThereExt = (msiName.Find(L'.') >= 0); + bool isMsiSpec = (msiName[0] == k_Msi_SpecChar); if (msiName.Len() >= 4 && StringsAreEqualNoCase_Ascii(msiName.RightPtr(4), ".cab") - || msiName.Len() >= 3 && msiName[0] != k_Msi_SpecChar && StringsAreEqualNoCase_Ascii(msiName.RightPtr(3), "exe")) + || !isMsiSpec && msiName.Len() >= 3 && StringsAreEqualNoCase_Ascii(msiName.RightPtr(3), "exe") + || !isMsiSpec && !isThereExt) { numCabs++; MainSubfile = i; } } } + if (numCabs > 1) MainSubfile = -1; |