diff options
author | 2016-05-12 00:06:54 +1000 | |
---|---|---|
committer | 2016-05-12 00:06:54 +1000 | |
commit | 7a423d0160839b28446d4100087c07019a75399d (patch) | |
tree | 2e3e37c5be23772c894ce523608d139bb450d543 /3rdparty/lzma/CPP/7zip/UI/Common/OpenArchive.cpp | |
parent | 6a53a6aeff4f6436210127eeb5dc9111b2da00f4 (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.cpp | 37 |
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); |