summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-05-12 00:06:54 +1000
committer Vas Crabb <vas@vastheman.com>2016-05-12 00:06:54 +1000
commit7a423d0160839b28446d4100087c07019a75399d (patch)
tree2e3e37c5be23772c894ce523608d139bb450d543 /3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
parent6a53a6aeff4f6436210127eeb5dc9111b2da00f4 (diff)
Update to LZMA 16.0 [Vas Crabb]
Diffstat (limited to '3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp')
-rw-r--r--3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp b/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
index e323abd2197..4081b0a67d4 100644
--- a/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
+++ b/3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp
@@ -1632,6 +1632,36 @@ HRESULT CArc::OpenStream2(const COpenOptions &op)
#endif
{
+ #ifndef _SFX
+
+ bool isZip = false;
+ bool isRar = false;
+
+ const wchar_t c = extension[0];
+ if (c == 'z' || c == 'Z' || c == 'r' || c == 'R')
+ {
+ bool isNumber = false;
+ for (unsigned k = 1;; k++)
+ {
+ const wchar_t d = extension[k];
+ if (d == 0)
+ break;
+ if (d < '0' || d > '9')
+ {
+ isNumber = false;
+ break;
+ }
+ isNumber = true;
+ }
+ if (isNumber)
+ if (c == 'z' || c == 'Z')
+ isZip = true;
+ else
+ isRar = true;
+ }
+
+ #endif
+
FOR_VECTOR (i, op.codecs->Formats)
{
const CArcInfoEx &ai = op.codecs->Formats[i];
@@ -1647,7 +1677,12 @@ HRESULT CArc::OpenStream2(const COpenOptions &op)
isPrearcExt = true;
#endif
- if (ai.FindExtension(extension) >= 0)
+ if (ai.FindExtension(extension) >= 0
+ #ifndef _SFX
+ || isZip && StringsAreEqualNoCase_Ascii(ai.Name, "zip")
+ || isRar && StringsAreEqualNoCase_Ascii(ai.Name, "rar")
+ #endif
+ )
{
// PrintNumber("orderIndices.Insert", i);
orderIndices.Insert(numFinded++, i);