diff options
author | XhmikosR <xhmikosr@gmail.com> | 2015-04-08 14:50:52 +0300 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2015-04-10 00:25:06 +0300 |
commit | fc260857f23feb38a9ccd10845ebe60042398d8a (patch) | |
tree | 53215d205c29c83f30ac1b5956ee61ae33562574 /src/thirdparty/unrar | |
parent | 766118f1c6483a1c9da167d7a02d9d389ba94b28 (diff) |
Update Unrar to v5.2.7.
Diffstat (limited to 'src/thirdparty/unrar')
-rw-r--r-- | src/thirdparty/unrar/dll.rc | 4 | ||||
-rw-r--r-- | src/thirdparty/unrar/extract.cpp | 7 | ||||
-rw-r--r-- | src/thirdparty/unrar/filestr.cpp | 16 | ||||
-rw-r--r-- | src/thirdparty/unrar/strfn.cpp | 2 | ||||
-rw-r--r-- | src/thirdparty/unrar/timefn.cpp | 2 | ||||
-rw-r--r-- | src/thirdparty/unrar/uiconsole.cpp | 15 | ||||
-rw-r--r-- | src/thirdparty/unrar/ulinks.cpp | 2 | ||||
-rw-r--r-- | src/thirdparty/unrar/unpack50mt.cpp | 3 |
8 files changed, 36 insertions, 15 deletions
diff --git a/src/thirdparty/unrar/dll.rc b/src/thirdparty/unrar/dll.rc index 7de848921..fa7ab25cb 100644 --- a/src/thirdparty/unrar/dll.rc +++ b/src/thirdparty/unrar/dll.rc @@ -2,8 +2,8 @@ #include <commctrl.h>
VS_VERSION_INFO VERSIONINFO
-FILEVERSION 5, 21, 100, 1509
-PRODUCTVERSION 5, 21, 100, 1509
+FILEVERSION 5, 21, 100, 1510
+PRODUCTVERSION 5, 21, 100, 1510
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
diff --git a/src/thirdparty/unrar/extract.cpp b/src/thirdparty/unrar/extract.cpp index 26be36ac2..a24eb9405 100644 --- a/src/thirdparty/unrar/extract.cpp +++ b/src/thirdparty/unrar/extract.cpp @@ -387,9 +387,13 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat) if (Arc.FileHead.Encrypted)
{
+ // Stop archive extracting if user cancelled a password prompt.
#ifdef RARDLL
if (!ExtrDllGetPassword())
+ {
+ Cmd->DllError=ERAR_MISSING_PASSWORD;
return false;
+ }
#else
if (!ExtrGetPassword(Arc,ArcFileName))
{
@@ -398,6 +402,9 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat) }
#endif
// Skip only the current encrypted file if empty password is entered.
+ // Actually our "cancel" code above intercepts empty passwords too now,
+ // so we keep the code below just in case we'll decide process empty
+ // and cancelled passwords differently sometimes.
if (!Cmd->Password.IsSet())
{
ErrHandler.SetErrorCode(RARX_WARNING);
diff --git a/src/thirdparty/unrar/filestr.cpp b/src/thirdparty/unrar/filestr.cpp index a87384f24..5fa946a4d 100644 --- a/src/thirdparty/unrar/filestr.cpp +++ b/src/thirdparty/unrar/filestr.cpp @@ -38,16 +38,20 @@ bool ReadTextFile( unsigned int DataSize=0,ReadSize; const int ReadBlock=4096; - Array<char> Data(ReadBlock+3); + + // Our algorithm below needs at least two trailing zeroes after data. + // So for Unicode we provide 2 Unicode zeroes and one more byte + // in case read Unicode data contains uneven number of bytes. + const size_t ZeroPadding=5; + + Array<char> Data(ReadBlock+ZeroPadding); while ((ReadSize=SrcFile.Read(&Data[DataSize],ReadBlock))!=0) { DataSize+=ReadSize; - Data.Add(ReadSize); + Data.Add(ReadSize); // Always have ReadBlock available for next data. } - - // Add trailing Unicode zero after text data. We add 3 bytes instead of 2 - // in case read Unicode data contains uneven number of bytes. - memset(&Data[DataSize],0,3); + + memset(&Data[DataSize],0,ZeroPadding); // Provide at least 2 Unicode zero bytes. Array<wchar> WideStr; diff --git a/src/thirdparty/unrar/strfn.cpp b/src/thirdparty/unrar/strfn.cpp index f83482fb2..e234da834 100644 --- a/src/thirdparty/unrar/strfn.cpp +++ b/src/thirdparty/unrar/strfn.cpp @@ -19,7 +19,7 @@ void IntToExt(const char *Src,char *Dest,size_t DestSize) Dest[DestSize-1]=0; #elif defined(_ANDROID) wchar DestW[NM]; - UnkToWide(Src,DestW,ASIZE(DestW)); + JniCharToWide(Src,DestW,ASIZE(DestW),true); WideToChar(DestW,Dest,DestSize); #else if (Dest!=Src) diff --git a/src/thirdparty/unrar/timefn.cpp b/src/thirdparty/unrar/timefn.cpp index 3fa535f4c..ba9f49686 100644 --- a/src/thirdparty/unrar/timefn.cpp +++ b/src/thirdparty/unrar/timefn.cpp @@ -223,7 +223,7 @@ void RarTime::GetText(wchar *DateStr,size_t MaxSize,bool FullYear,bool FullMS) RarLocalTime lt; GetLocal(<); if (FullMS) - swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u,%03u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute,lt.Reminder/10000); + swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u:%02u,%03u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute,lt.Second,lt.Reminder/10000); else if (FullYear) swprintf(DateStr,MaxSize,L"%02u-%02u-%u %02u:%02u",lt.Day,lt.Month,lt.Year,lt.Hour,lt.Minute); diff --git a/src/thirdparty/unrar/uiconsole.cpp b/src/thirdparty/unrar/uiconsole.cpp index b9129c4f7..ba7550c6b 100644 --- a/src/thirdparty/unrar/uiconsole.cpp +++ b/src/thirdparty/unrar/uiconsole.cpp @@ -9,10 +9,17 @@ UIASKREP_RESULT uiAskReplace(wchar *Name,size_t MaxNameSize,int64 FileSize,RarTi itoa(ExistingFD.Size,SizeText1); ExistingFD.mtime.GetText(DateStr1,ASIZE(DateStr1),true,false); - itoa(FileSize,SizeText2); - FileTime->GetText(DateStr2,ASIZE(DateStr2),true,false); - - eprintf(St(MAskReplace),Name,SizeText1,DateStr1,SizeText2,DateStr2); + if (FileSize==INT64NDF || FileTime==NULL) + { + eprintf(L"\n"); + eprintf(St(MAskOverwrite),Name); + } + else + { + itoa(FileSize,SizeText2); + FileTime->GetText(DateStr2,ASIZE(DateStr2),true,false); + eprintf(St(MAskReplace),Name,SizeText1,DateStr1,SizeText2,DateStr2); + } bool AllowRename=(Flags & UIASKREP_F_NORENAME)==0; int Choice=0; diff --git a/src/thirdparty/unrar/ulinks.cpp b/src/thirdparty/unrar/ulinks.cpp index f3e51b52e..c6d2f874a 100644 --- a/src/thirdparty/unrar/ulinks.cpp +++ b/src/thirdparty/unrar/ulinks.cpp @@ -56,7 +56,7 @@ bool ExtractUnixLink30(CommandData *Cmd,ComprDataIO &DataIO,Archive &Arc,const w if (!Cmd->AbsoluteLinks && (IsFullPath(Target) || !IsRelativeSymlinkSafe(Arc.FileHead.FileName,Arc.FileHead.RedirName))) - + return false; return UnixSymlink(Target,LinkName,&Arc.FileHead.mtime,&Arc.FileHead.atime); } return false; diff --git a/src/thirdparty/unrar/unpack50mt.cpp b/src/thirdparty/unrar/unpack50mt.cpp index a013b27e6..9925cf2b8 100644 --- a/src/thirdparty/unrar/unpack50mt.cpp +++ b/src/thirdparty/unrar/unpack50mt.cpp @@ -90,6 +90,9 @@ void Unpack::Unpack5MT(bool Solid) DataSize+=ReadSize; if (DataSize==0) break; + + // First read chunk can be small if we are near the end of volume + // and we want it to fit block header and tables. if (ReadSize>0 && DataSize<TooSmallToProcess) continue; |