Hello community, here is the log from the commit of package unrar for openSUSE:Factory:NonFree checked in at 2014-10-17 11:30:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory:NonFree/unrar (Old) and /work/SRC/openSUSE:Factory:NonFree/.unrar.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "unrar" Changes: -------- --- /work/SRC/openSUSE:Factory:NonFree/unrar/unrar.changes 2014-09-29 12:57:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory:NonFree/.unrar.new/unrar.changes 2014-10-17 11:30:59.000000000 +0200 @@ -1,0 +2,8 @@ +Tue Oct 14 15:57:22 UTC 2014 - lazy.k...@opensuse.org + +- Update to 5.2.1. + * Based on rar 5.20 beta 1. + * File overwrite prompt in unrar displays the size and + modification time for existing and new files. + +------------------------------------------------------------------- Old: ---- unrarsrc-5.1.7.tar.gz New: ---- unrarsrc-5.2.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ unrar.spec ++++++ --- /var/tmp/diff_new_pack.PpmaZV/_old 2014-10-17 11:31:00.000000000 +0200 +++ /var/tmp/diff_new_pack.PpmaZV/_new 2014-10-17 11:31:00.000000000 +0200 @@ -18,10 +18,10 @@ # majorversion should match the major version number. %define majorversion 5 -%define libsuffix 5_1_7 +%define libsuffix 5_2_1 Name: unrar -Version: 5.1.7 +Version: 5.2.1 Release: 0 License: SUSE-NonFree Summary: A program to extract, test, and view RAR archives ++++++ unrarsrc-5.1.7.tar.gz -> unrarsrc-5.2.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/arcread.cpp new/unrar/arcread.cpp --- old/unrar/arcread.cpp 2014-08-06 16:00:14.000000000 +0200 +++ new/unrar/arcread.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -893,6 +893,7 @@ ErrHandler.Exit(RARX_USERBREAK); } #endif + Cmd->ManualPassword=true; } } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/cmddata.cpp new/unrar/cmddata.cpp --- old/unrar/cmddata.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/cmddata.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -13,7 +13,6 @@ *Command=0; *ArcName=0; FileLists=false; - NoMoreSwitches=false; ListMode=RCLM_AUTO; @@ -47,6 +46,8 @@ #if !defined(SFX_MODULE) && !defined(_ANDROID) void CommandData::ParseCommandLine(bool Preprocess,int argc, char *argv[]) { + *Command=0; + NoMoreSwitches=false; #ifdef CUSTOM_CMDLINE_PARSER // In Windows we may prefer to implement our own command line parser // to avoid replacing \" by " in standard parser. Such replacing corrupts @@ -58,15 +59,12 @@ { if ((CmdLine=AllocCmdParam(CmdLine,&Par))==NULL) break; - bool Code=true; if (!FirstParam) // First parameter is the executable name. if (Preprocess) - Code=PreprocessSwitch(Par); + PreprocessArg(Par); else ParseArg(Par); free(Par); - if (Preprocess && !Code) - break; } #else Array<wchar> Arg; @@ -75,10 +73,7 @@ Arg.Alloc(strlen(argv[I])+1); CharToWide(argv[I],&Arg[0],Arg.Size()); if (Preprocess) - { - if (!PreprocessSwitch(&Arg[0])) - break; - } + PreprocessArg(&Arg[0]); else ParseArg(&Arg[0]); } @@ -93,7 +88,7 @@ void CommandData::ParseArg(wchar *Arg) { if (IsSwitch(*Arg) && !NoMoreSwitches) - if (Arg[1]=='-') + if (Arg[1]=='-' && Arg[2]==0) NoMoreSwitches=true; else ProcessSwitch(Arg+1); @@ -199,37 +194,37 @@ #if !defined(SFX_MODULE) && !defined(_ANDROID) // Preprocess those parameters, which must be processed before the rest of // command line. Return 'false' to stop further processing. -bool CommandData::PreprocessSwitch(const wchar *Switch) +void CommandData::PreprocessArg(const wchar *Arg) { - if (IsSwitch(Switch[0])) + if (IsSwitch(Arg[0]) && !NoMoreSwitches) { - Switch++; - char SwitchA[1024]; - WideToChar(Switch,SwitchA,ASIZE(SwitchA)); - if (wcsicomp(Switch,L"-")==0) // Switch "--". - return false; - if (wcsicomp(Switch,L"cfg-")==0) + Arg++; + if (Arg[0]=='-' && Arg[1]==0) // Switch "--". + NoMoreSwitches=true; + if (wcsicomp(Arg,L"cfg-")==0) ConfigDisabled=true; #ifndef GUI - if (wcsnicomp(Switch,L"ilog",4)==0) + if (wcsnicomp(Arg,L"ilog",4)==0) { // Ensure that correct log file name is already set // if we need to report an error when processing the command line. - ProcessSwitch(Switch); + ProcessSwitch(Arg); InitLogOptions(LogName,ErrlogCharset); } #endif - if (wcsnicomp(Switch,L"sc",2)==0) + if (wcsnicomp(Arg,L"sc",2)==0) { // Process -sc before reading any file lists. - ProcessSwitch(Switch); + ProcessSwitch(Arg); #ifndef GUI if (*LogName!=0) InitLogOptions(LogName,ErrlogCharset); #endif } } - return true; + else + if (*Command==0) + wcsncpy(Command,Arg,ASIZE(Command)); // Need for rar.ini. } #endif @@ -247,6 +242,22 @@ Str++; if (wcsnicomp(Str,L"switches=",9)==0) ProcessSwitchesString(Str+9); + if (*Command!=0) + { + wchar Cmd[16]; + wcsncpyz(Cmd,Command,ASIZE(Cmd)); + wchar C0=toupperw(Cmd[0]); + wchar C1=toupperw(Cmd[1]); + if (C0=='I' || C0=='L' || C0=='M' || C0=='S' || C0=='V') + Cmd[1]=0; + if (C0=='R' && (C1=='R' || C1=='V')) + Cmd[2]=0; + wchar SwName[16+ASIZE(Cmd)]; + swprintf(SwName,ASIZE(SwName),L"switches_%s=",Cmd); + size_t Length=wcslen(SwName); + if (wcsnicomp(Str,SwName,Length)==0) + ProcessSwitchesString(Str+Length); + } } } } @@ -1010,7 +1021,7 @@ return true; if (!CheckInclList || InclArgs.ItemsCount()==0) return false; - if (ExclCheckArgs(&InclArgs,Dir,CheckName,false,MATCH_WILDSUBPATH)) + if (ExclCheckArgs(&InclArgs,Dir,CheckName,CheckFullPath,MATCH_WILDSUBPATH)) return false; return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/cmddata.hpp new/unrar/cmddata.hpp --- old/unrar/cmddata.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/cmddata.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -28,7 +28,7 @@ void ParseDone(); void ParseEnvVar(); void ReadConfig(); - bool PreprocessSwitch(const wchar *Switch); + void PreprocessArg(const wchar *Arg); void OutTitle(); void OutHelp(RAR_EXIT ExitCode); bool IsSwitch(int Ch); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/crypt.cpp new/unrar/crypt.cpp --- old/unrar/crypt.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/crypt.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -11,15 +11,18 @@ CryptData::CryptData() { Method=CRYPT_NONE; - memset(KDFCache,0,sizeof(KDFCache)); - KDFCachePos=0; + memset(KDF3Cache,0,sizeof(KDF3Cache)); + memset(KDF5Cache,0,sizeof(KDF5Cache)); + KDF3CachePos=0; + KDF5CachePos=0; memset(CRCTab,0,sizeof(CRCTab)); } CryptData::~CryptData() { - cleandata(KDFCache,sizeof(KDFCache)); + cleandata(KDF3Cache,sizeof(KDF3Cache)); + cleandata(KDF5Cache,sizeof(KDF5Cache)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/crypt.hpp new/unrar/crypt.hpp --- old/unrar/crypt.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/crypt.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -20,18 +20,28 @@ #define CRYPT_VERSION 0 // Supported encryption version. -struct KDFCacheItem -{ - SecPassword Pwd; - byte Salt[SIZE_SALT50]; - uint Lg2Count; // Log2 of PBKDF2 repetition count. - byte Key[32]; - byte PswCheckValue[SHA256_DIGEST_SIZE]; - byte HashKeyValue[SHA256_DIGEST_SIZE]; -}; - class CryptData { + struct KDF5CacheItem + { + SecPassword Pwd; + byte Salt[SIZE_SALT50]; + byte Key[32]; + uint Lg2Count; // Log2 of PBKDF2 repetition count. + byte PswCheckValue[SHA256_DIGEST_SIZE]; + byte HashKeyValue[SHA256_DIGEST_SIZE]; + }; + + struct KDF3CacheItem + { + SecPassword Pwd; + byte Salt[SIZE_SALT30]; + byte Key[16]; + byte Init[16]; + bool SaltPresent; + }; + + private: void SetKey13(const char *Password); void Decrypt13(byte *Data,size_t Count); @@ -46,10 +56,13 @@ void DecryptBlock20(byte *Buf); void SetKey30(bool Encrypt,SecPassword *Password,const wchar *PwdW,const byte *Salt); - void SetKey50(bool Encrypt,SecPassword *Password,const wchar *PwdW,const byte *Salt,const byte *InitV,uint Lg2Cnt,byte *HashKey,byte *PswCheck); - KDFCacheItem KDFCache[4]; - uint KDFCachePos; + + KDF3CacheItem KDF3Cache[4]; + uint KDF3CachePos; + + KDF5CacheItem KDF5Cache[4]; + uint KDF5CachePos; CRYPT_METHOD Method; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/crypt3.cpp new/unrar/crypt3.cpp --- old/unrar/crypt3.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/crypt3.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -1,38 +1,15 @@ -struct CryptKeyCacheItem -{ - CryptKeyCacheItem() - { - Password.Set(L""); - } - - ~CryptKeyCacheItem() - { - cleandata(AESKey,sizeof(AESKey)); - cleandata(AESInit,sizeof(AESInit)); - cleandata(&Password,sizeof(Password)); - } - - byte AESKey[16],AESInit[16]; - SecPassword Password; - bool SaltPresent; - byte Salt[SIZE_SALT30]; -}; - -static CryptKeyCacheItem Cache[4]; -static int CachePos=0; - void CryptData::SetKey30(bool Encrypt,SecPassword *Password,const wchar *PwdW,const byte *Salt) { byte AESKey[16],AESInit[16]; bool Cached=false; - for (uint I=0;I<ASIZE(Cache);I++) - if (Cache[I].Password==*Password && - (Salt==NULL && !Cache[I].SaltPresent || Salt!=NULL && - Cache[I].SaltPresent && memcmp(Cache[I].Salt,Salt,SIZE_SALT30)==0)) + for (uint I=0;I<ASIZE(KDF3Cache);I++) + if (KDF3Cache[I].Pwd==*Password && + (Salt==NULL && !KDF3Cache[I].SaltPresent || Salt!=NULL && + KDF3Cache[I].SaltPresent && memcmp(KDF3Cache[I].Salt,Salt,SIZE_SALT30)==0)) { - memcpy(AESKey,Cache[I].AESKey,sizeof(AESKey)); - memcpy(AESInit,Cache[I].AESInit,sizeof(AESInit)); + memcpy(AESKey,KDF3Cache[I].Key,sizeof(AESKey)); + memcpy(AESInit,KDF3Cache[I].Init,sizeof(AESInit)); Cached=true; break; } @@ -73,12 +50,12 @@ for (int J=0;J<4;J++) AESKey[I*4+J]=(byte)(digest[I]>>(J*8)); - Cache[CachePos].Password=*Password; - if ((Cache[CachePos].SaltPresent=(Salt!=NULL))==true) - memcpy(Cache[CachePos].Salt,Salt,SIZE_SALT30); - memcpy(Cache[CachePos].AESKey,AESKey,sizeof(AESKey)); - memcpy(Cache[CachePos].AESInit,AESInit,sizeof(AESInit)); - CachePos=(CachePos+1)%ASIZE(Cache); + KDF3Cache[KDF3CachePos].Pwd=*Password; + if ((KDF3Cache[KDF3CachePos].SaltPresent=(Salt!=NULL))==true) + memcpy(KDF3Cache[KDF3CachePos].Salt,Salt,SIZE_SALT30); + memcpy(KDF3Cache[KDF3CachePos].Key,AESKey,sizeof(AESKey)); + memcpy(KDF3Cache[KDF3CachePos].Init,AESInit,sizeof(AESInit)); + KDF3CachePos=(KDF3CachePos+1)%ASIZE(KDF3Cache); cleandata(RawPsw,sizeof(RawPsw)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/crypt5.cpp new/unrar/crypt5.cpp --- old/unrar/crypt5.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/crypt5.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -98,15 +98,15 @@ byte Key[32],PswCheckValue[SHA256_DIGEST_SIZE],HashKeyValue[SHA256_DIGEST_SIZE]; bool Found=false; - for (uint I=0;I<ASIZE(KDFCache);I++) + for (uint I=0;I<ASIZE(KDF5Cache);I++) { - KDFCacheItem *Item=KDFCache+I; + KDF5CacheItem *Item=KDF5Cache+I; if (Item->Lg2Count==Lg2Cnt && Item->Pwd==*Password && memcmp(Item->Salt,Salt,SIZE_SALT50)==0) { - SecHideData(Item->Key,sizeof(Item->Key),false); + SecHideData(Item->Key,sizeof(Item->Key),false,false); memcpy(Key,Item->Key,sizeof(Key)); - SecHideData(Item->Key,sizeof(Item->Key),true); + SecHideData(Item->Key,sizeof(Item->Key),true,false); memcpy(PswCheckValue,Item->PswCheckValue,sizeof(PswCheckValue)); memcpy(HashKeyValue,Item->HashKeyValue,sizeof(HashKeyValue)); @@ -123,14 +123,14 @@ pbkdf2((byte *)PwdUtf,strlen(PwdUtf),Salt,SIZE_SALT50,Key,HashKeyValue,PswCheckValue,(1<<Lg2Cnt)); cleandata(PwdUtf,sizeof(PwdUtf)); - KDFCacheItem *Item=KDFCache+(KDFCachePos++ % ASIZE(KDFCache)); + KDF5CacheItem *Item=KDF5Cache+(KDF5CachePos++ % ASIZE(KDF5Cache)); Item->Lg2Count=Lg2Cnt; Item->Pwd=*Password; memcpy(Item->Salt,Salt,SIZE_SALT50); memcpy(Item->Key,Key,sizeof(Key)); memcpy(Item->PswCheckValue,PswCheckValue,sizeof(PswCheckValue)); memcpy(Item->HashKeyValue,HashKeyValue,sizeof(HashKeyValue)); - SecHideData(Item->Key,sizeof(Key),true); + SecHideData(Item->Key,sizeof(Key),true,false); } if (HashKey!=NULL) memcpy(HashKey,HashKeyValue,SHA256_DIGEST_SIZE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/dll.rc new/unrar/dll.rc --- old/unrar/dll.rc 2014-08-06 15:52:53.000000000 +0200 +++ new/unrar/dll.rc 2014-10-05 20:14:34.000000000 +0200 @@ -2,8 +2,8 @@ #include <commctrl.h> VS_VERSION_INFO VERSIONINFO -FILEVERSION 5, 11, 1, 1315 -PRODUCTVERSION 5, 11, 1, 1315 +FILEVERSION 5, 20, 1, 1376 +PRODUCTVERSION 5, 20, 1, 1376 FILEOS VOS__WINDOWS32 FILETYPE VFT_APP { @@ -14,8 +14,8 @@ VALUE "CompanyName", "Alexander Roshal\0" VALUE "ProductName", "RAR decompression library\0" VALUE "FileDescription", "RAR decompression library\0" - VALUE "FileVersion", "5.11.1\0" - VALUE "ProductVersion", "5.11.1\0" + VALUE "FileVersion", "5.20.1\0" + VALUE "ProductVersion", "5.20.1\0" VALUE "LegalCopyright", "Copyright � Alexander Roshal 1993-2014\0" VALUE "OriginalFilename", "Unrar.dll\0" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/extract.cpp new/unrar/extract.cpp --- old/unrar/extract.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/extract.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -9,7 +9,6 @@ *DestFileName=0; TotalFileCount=0; - Password.Set(L""); Unp=new Unpack(&DataIO); #ifdef RAR_SMP Unp->SetThreads(Cmd->Threads); @@ -25,6 +24,9 @@ void CmdExtract::DoExtract() { +#if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT) + Fat32=NotFat32=false; +#endif PasswordCancelled=false; DataIO.SetCurrentCommand(Cmd->Command[0]); @@ -36,17 +38,11 @@ Cmd->ArcNames.Rewind(); while (Cmd->GetArcName(ArcName,ASIZE(ArcName))) { + if (Cmd->ManualPassword) + Cmd->Password.Clean(); // Clean user entered password before processing next archive. while (true) { - SecPassword PrevCmdPassword; - PrevCmdPassword=Cmd->Password; - EXTRACT_ARC_CODE Code=ExtractArchive(); - - // Restore Cmd->Password, which could be changed in IsArchive() call - // for next header encrypted archive. - Cmd->Password=PrevCmdPassword; - if (Code!=EXTRACT_ARC_REPEAT) break; } @@ -86,8 +82,6 @@ #endif PasswordAll=(Cmd->Password.IsSet()); - if (PasswordAll) - Password=Cmd->Password; DataIO.UnpVolume=false; @@ -262,7 +256,7 @@ int MatchNumber=Cmd->IsProcessFile(Arc.FileHead,&EqualNames,MatchType); bool ExactMatch=MatchNumber!=0; #ifndef SFX_MODULE - if (Cmd->ExclPath==EXCL_BASEPATH) + if (*Cmd->ArcPath==0 && Cmd->ExclPath==EXCL_BASEPATH) { *Cmd->ArcPath=0; if (ExactMatch) @@ -400,7 +394,7 @@ } #endif // Skip only the current encrypted file if empty password is entered. - if (!Password.IsSet()) + if (!Cmd->Password.IsSet()) { ErrHandler.SetErrorCode(RARX_WARNING); #ifdef RARDLL @@ -430,7 +424,6 @@ #endif } - File CurFile; bool LinkEntry=Arc.FileHead.RedirType!=FSREDIR_NONE; @@ -510,7 +503,7 @@ mprintf(L" "); #endif - SecPassword FilePassword=Password; + SecPassword FilePassword=Cmd->Password; #if defined(_WIN_ALL) && !defined(SFX_MODULE) ConvertDosPassword(Arc,FilePassword); #endif @@ -540,6 +533,18 @@ DataIO.SetFiles(&Arc,&CurFile); DataIO.SetTestMode(TestMode); DataIO.SetSkipUnpCRC(SkipSolid); + +#if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT) + if (!TestMode && !WrongPassword && !Arc.BrokenHeader && + Arc.FileHead.UnpSize>0xffffffff && (Fat32 || !NotFat32)) + { + if (!Fat32) // Not detected yet. + NotFat32=!(Fat32=IsFAT(Cmd->ExtrPath)); + if (Fat32) + uiMsg(UIMSG_FAT32SIZE); // Inform user about FAT32 size limit. + } +#endif + if (!TestMode && !WrongPassword && !Arc.BrokenHeader && (Arc.FileHead.PackSize<<11)>Arc.FileHead.UnpSize && (Arc.FileHead.UnpSize<100000000 || Arc.FileLength()>Arc.FileHead.PackSize)) @@ -862,11 +867,11 @@ } Cmd->Password.Set(PasswordW); cleandata(PasswordW,sizeof(PasswordW)); + Cmd->ManualPassword=true; } if (!Cmd->Password.IsSet()) return false; } - Password=Cmd->Password; return true; } #endif @@ -875,14 +880,15 @@ #ifndef RARDLL bool CmdExtract::ExtrGetPassword(Archive &Arc,const wchar *ArcFileName) { - if (!Password.IsSet()) + if (!Cmd->Password.IsSet()) { - if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Password)) + if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Cmd->Password)) { uiMsg(UIERROR_INCERRCOUNT); return false; } + Cmd->ManualPassword=true; } #if !defined(GUI) && !defined(SILENT) else @@ -894,7 +900,7 @@ case -1: ErrHandler.Exit(RARX_USERBREAK); case 2: - if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Password)) + if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Cmd->Password)) return false; break; case 3: @@ -916,7 +922,7 @@ // We need the password in OEM encoding if file was encrypted by // native RAR/DOS (not extender based). Let's make the conversion. wchar PlainPsw[MAXPASSWORD]; - Password.Get(PlainPsw,ASIZE(PlainPsw)); + Cmd->Password.Get(PlainPsw,ASIZE(PlainPsw)); char PswA[MAXPASSWORD]; CharToOemBuffW(PlainPsw,PswA,ASIZE(PswA)); PswA[ASIZE(PswA)-1]=0; @@ -957,6 +963,18 @@ { CreatePath(DestFileName,true); MDCode=MakeDir(DestFileName,!Cmd->IgnoreGeneralAttr,Arc.FileHead.FileAttr); + if (MDCode!=MKDIR_SUCCESS) + { + wchar OrigName[ASIZE(DestFileName)]; + wcsncpyz(OrigName,DestFileName,ASIZE(OrigName)); + MakeNameUsable(DestFileName,true); + CreatePath(DestFileName,true); + MDCode=MakeDir(DestFileName,!Cmd->IgnoreGeneralAttr,Arc.FileHead.FileAttr); +#ifndef SFX_MODULE + if (MDCode==MKDIR_SUCCESS) + uiMsg(UIERROR_RENAMING,Arc.FileName,OrigName,DestFileName); +#endif + } } } if (MDCode==MKDIR_SUCCESS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/extract.hpp new/unrar/extract.hpp --- old/unrar/extract.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/extract.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -43,11 +43,13 @@ wchar ArcName[NM]; - SecPassword Password; bool PasswordAll; bool PrevExtracted; wchar DestFileName[NM]; bool PasswordCancelled; +#if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT) + bool Fat32,NotFat32; +#endif public: CmdExtract(CommandData *Cmd); ~CmdExtract(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/file.cpp new/unrar/file.cpp --- old/unrar/file.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/file.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -52,7 +52,7 @@ uint Access=WriteMode ? GENERIC_WRITE:GENERIC_READ; if (UpdateMode) Access|=GENERIC_WRITE; - uint ShareMode=FILE_SHARE_READ; + uint ShareMode=(Mode & FMF_OPENEXCLUSIVE) ? 0 : FILE_SHARE_READ; if (OpenShared) ShareMode|=FILE_SHARE_WRITE; uint Flags=NoSequentialRead ? 0:FILE_FLAG_SEQUENTIAL_SCAN; @@ -167,7 +167,16 @@ CreateMode=Mode; uint Access=WriteMode ? GENERIC_WRITE:GENERIC_READ|GENERIC_WRITE; DWORD ShareMode=ShareRead ? FILE_SHARE_READ:0; - hFile=CreateFile(Name,Access,ShareMode,NULL,CREATE_ALWAYS,0,NULL); + + // Windows automatically removes dots and spaces in the end of file name, + // So we detect such names and process them with \\?\ prefix. + wchar *LastChar=PointToLastChar(Name); + bool Special=*LastChar=='.' || *LastChar==' '; + + if (Special) + hFile=BAD_HANDLE; + else + hFile=CreateFile(Name,Access,ShareMode,NULL,CREATE_ALWAYS,0,NULL); if (hFile==BAD_HANDLE) { @@ -390,8 +399,8 @@ if (HandleType==FILE_HANDLESTD) { #ifdef _WIN_ALL - if (Size>MaxDeviceRead) - Size=MaxDeviceRead; +// if (Size>MaxDeviceRead) +// Size=MaxDeviceRead; hFile=GetStdHandle(STD_INPUT_HANDLE); #else #ifdef FILE_USE_OPEN @@ -402,6 +411,8 @@ #endif } #ifdef _WIN_ALL + // For pipes like 'type file.txt | rar -si arcname' ReadFile may return + // data in small ~4KB blocks. It may slightly reduce the compression ratio. DWORD Read; if (!ReadFile(hFile,Data,(DWORD)Size,&Read,NULL)) { @@ -650,7 +661,7 @@ #ifndef SFX_MODULE int64 File::Copy(File &Dest,int64 Length) { - Array<char> Buffer(0x10000); + Array<char> Buffer(0x40000); int64 CopySize=0; bool CopyAll=(Length==INT64NDF); @@ -667,7 +678,7 @@ // For FAT32 USB flash drives in Windows if first write is 4 KB or more, // write caching is disabled and "write through" is enabled, resulting // in bad performance, especially for many small files. It happens when - // we create SFX archive on USB drive, because SFX module is writetn first. + // we create SFX archive on USB drive, because SFX module is written first. // So we split the first write to small 1 KB followed by rest of data. if (CopySize==0 && WriteSize>=4096) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/file.hpp new/unrar/file.hpp --- old/unrar/file.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/file.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -35,8 +35,11 @@ // Open files which are already opened for write by other programs. FMF_OPENSHARED=4, + // Open files only if no other program is opened it even in shared mode. + FMF_OPENEXCLUSIVE=8, + // Provide read access to created file for other programs. - FMF_SHAREREAD=8, + FMF_SHAREREAD=16, // Mode flags are not defined yet. FMF_UNDEFINED=256 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/filefn.cpp new/unrar/filefn.cpp --- old/unrar/filefn.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/filefn.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -3,7 +3,11 @@ MKDIR_CODE MakeDir(const wchar *Name,bool SetAttr,uint Attr) { #ifdef _WIN_ALL - BOOL RetCode=CreateDirectory(Name,NULL); + // Windows automatically removes dots and spaces in the end of directory + // name. So we detect such names and process them with \\?\ prefix. + wchar *LastChar=PointToLastChar(Name); + bool Special=*LastChar=='.' || *LastChar==' '; + BOOL RetCode=Special ? FALSE : CreateDirectory(Name,NULL); if (RetCode==0 && !FileExist(Name)) { wchar LongName[NM]; @@ -169,6 +173,19 @@ #endif +#if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT) +// Return 'true' for FAT and FAT32, so we can adjust the maximum supported +// file size to 4 GB for these file systems. +bool IsFAT(const wchar *Name) +{ + wchar Root[NM]; + GetPathRoot(Name,Root,ASIZE(Root)); + wchar FileSystem[MAX_PATH+1]; + if (GetVolumeInformation(Root,NULL,0,NULL,NULL,NULL,FileSystem,ASIZE(FileSystem))) + return wcscmp(FileSystem,L"FAT")==0 || wcscmp(FileSystem,L"FAT32")==0; + return false; +} +#endif bool FileExist(const wchar *Name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/filefn.hpp new/unrar/filefn.hpp --- old/unrar/filefn.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/filefn.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -12,6 +12,9 @@ int64 GetFreeDisk(const wchar *Name); #endif +#if defined(_WIN_ALL) && !defined(SFX_MODULE) && !defined(SILENT) +bool IsFAT(const wchar *Root); +#endif bool FileExist(const wchar *Name); bool WildFileExist(const wchar *Name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/filestr.cpp new/unrar/filestr.cpp --- old/unrar/filestr.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/filestr.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -37,15 +37,17 @@ SrcFile.SetHandleType(FILE_HANDLESTD); unsigned int DataSize=0,ReadSize; - const int ReadBlock=1024; - Array<char> Data(ReadBlock+5); + const int ReadBlock=4096; + Array<char> Data(ReadBlock+3); while ((ReadSize=SrcFile.Read(&Data[DataSize],ReadBlock))!=0) { DataSize+=ReadSize; Data.Add(ReadSize); } - memset(&Data[DataSize],0,5); + // 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); Array<wchar> WideStr; @@ -136,7 +138,7 @@ break; *SpacePtr=0; } - if (*CurStr) + if (*CurStr!=0) { if (Unquote && *CurStr=='\"') { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/list.cpp new/unrar/list.cpp --- old/unrar/list.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/list.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -18,6 +18,9 @@ wchar ArcName[NM]; while (Cmd->GetArcName(ArcName,ASIZE(ArcName))) { + if (Cmd->ManualPassword) + Cmd->Password.Clean(); // Clean user entered password before processing next archive. + Archive Arc(Cmd); #ifdef _WIN_ALL Arc.RemoveSequentialFlag(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/loclang.hpp new/unrar/loclang.hpp --- old/unrar/loclang.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/loclang.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -216,7 +216,7 @@ #define MExtrNoFiles L"\nNo files to extract" #define MExtrAllOk L"\nAll OK" #define MExtrTotalErr L"\nTotal errors: %ld" -#define MFileExists L"\n\n%s already exists. Overwrite it ?" +#define MAskReplace L"\n\nWould you like to replace the existing file %s\n%6s bytes, modified on %s\nwith a new one\n%6s bytes, modified on %s\n" #define MAskOverwrite L"\nOverwrite %s ?" #define MAskNewName L"\nEnter new name: " #define MHeaderBroken L"\nCorrupt header is found" @@ -344,6 +344,7 @@ #define MCreating L"\nCreating %s" #define MRenaming L"\nRenaming %s to %s" #define MNTFSRequired L"\nWrite error: only NTFS file system supports files larger than 4 GB" +#define MFAT32Size L"\nWARNING: FAT32 file system does not support 4 GB or larger files" #define MErrChangeAttr L"\nWARNING: Cannot change attributes of %s" #define MWrongSFXVer L"\nERROR: default SFX module does not support RAR %d.%d archives" #define MCannotEncName L"\nCannot encrypt archive already contained encrypted files" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/options.hpp new/unrar/options.hpp --- old/unrar/options.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/options.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -99,6 +99,9 @@ wchar ArcPath[NM]; SecPassword Password; bool EncryptHeaders; + + bool ManualPassword; // Password entered manually during operation, might need to clean for next archive. + wchar LogName[NM]; MESSAGE_TYPE MsgStream; bool Sound; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/pathfn.cpp new/unrar/pathfn.cpp --- old/unrar/pathfn.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/pathfn.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -196,7 +196,7 @@ #if defined(_WIN_ALL) && !defined(SFX_MODULE) -static void GetAppDataPath(wchar *Path,size_t MaxSize,bool Create) +bool GetAppDataPath(wchar *Path,size_t MaxSize,bool Create) { LPMALLOC g_pMalloc; SHGetMalloc(&g_pMalloc); @@ -212,12 +212,8 @@ if (!Success && Create) Success=MakeDir(Path,false,0)==MKDIR_SUCCESS; } - if (!Success) - { - GetModuleFileName(NULL,Path,(DWORD)MaxSize); - RemoveNameFromPath(Path); - } g_pMalloc->Free(ppidl); + return Success; } #endif @@ -237,7 +233,11 @@ } if (*Path==0 || !FileExist(Path)) - GetAppDataPath(Path,MaxSize,Create); + if (!GetAppDataPath(Path,MaxSize,Create)) + { + GetModuleFileName(NULL,Path,(DWORD)MaxSize); + RemoveNameFromPath(Path); + } } #endif @@ -436,10 +436,13 @@ #ifndef _UNIX if (s-Name>1 && *s==':') *s='_'; +#if 0 // We already can create such files. // Remove ' ' and '.' before path separator, but allow .\ and ..\. - if ((*s==' ' || *s=='.' && s>Name && !IsPathDiv(s[-1]) && s[-1]!='.') && IsPathDiv(s[1])) + if (IsPathDiv(s[1]) && (*s==' ' || *s=='.' && s>Name && + !IsPathDiv(s[-1]) && (s[-1]!='.' || s>Name+1 && !IsPathDiv(s[-2])))) *s='_'; #endif +#endif } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/pathfn.hpp new/unrar/pathfn.hpp --- old/unrar/pathfn.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/pathfn.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -17,9 +17,14 @@ void MakeName(const wchar *Path,const wchar *Name,wchar *Pathname,size_t MaxSize); void GetFilePath(const wchar *FullName,wchar *Path,size_t MaxLength); void RemoveNameFromPath(wchar *Path); +#if defined(_WIN_ALL) && !defined(SFX_MODULE) +bool GetAppDataPath(wchar *Path,size_t MaxSize,bool Create); void GetRarDataPath(wchar *Path,size_t MaxSize,bool Create); +#endif +#ifndef SFX_MODULE bool EnumConfigPaths(uint Number,wchar *Path,size_t MaxSize,bool Create); void GetConfigName(const wchar *Name,wchar *FullName,size_t MaxSize,bool CheckExist,bool Create); +#endif wchar* GetVolNumPart(const wchar *ArcName); void NextVolumeName(wchar *ArcName,uint MaxLength,bool OldNumbering); bool IsNameUsable(const wchar *Name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/secpassword.cpp new/unrar/secpassword.cpp --- old/unrar/secpassword.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/secpassword.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -7,6 +7,7 @@ #ifndef CRYPTPROTECTMEMORY_BLOCK_SIZE #define CRYPTPROTECTMEMORY_BLOCK_SIZE 16 #define CRYPTPROTECTMEMORY_SAME_PROCESS 0x00 +#define CRYPTPROTECTMEMORY_CROSS_PROCESS 0x01 #endif class CryptLoader @@ -48,12 +49,13 @@ CRYPTUNPROTECTMEMORY pCryptUnprotectMemory; }; -// We want to call FreeLibrary when RAR is exiting. +// We need to call FreeLibrary when RAR is exiting. CryptLoader GlobalCryptLoader; #endif SecPassword::SecPassword() { + CrossProcess=false; Set(L""); } @@ -99,7 +101,7 @@ // Source string can be shorter than destination as in case when we process // -p<pwd> parameter, so we need to take into account both sizes. memcpy(Dst,Src,Min(SrcSize,DstSize)*sizeof(*Dst)); - SecHideData(Dst,DstSize*sizeof(*Dst),Encode); + SecHideData(Dst,DstSize*sizeof(*Dst),Encode,CrossProcess); } @@ -156,18 +158,19 @@ } -void SecHideData(void *Data,size_t DataSize,bool Encode) +void SecHideData(void *Data,size_t DataSize,bool Encode,bool CrossProcess) { #ifdef _WIN_ALL // Try to utilize the secure Crypt[Un]ProtectMemory if possible. if (GlobalCryptLoader.pCryptProtectMemory==NULL) GlobalCryptLoader.Load(); size_t Aligned=DataSize-DataSize%CRYPTPROTECTMEMORY_BLOCK_SIZE; + DWORD Flags=CrossProcess ? CRYPTPROTECTMEMORY_CROSS_PROCESS : CRYPTPROTECTMEMORY_SAME_PROCESS; if (Encode) { if (GlobalCryptLoader.pCryptProtectMemory!=NULL) { - if (!GlobalCryptLoader.pCryptProtectMemory(Data,DWORD(Aligned),CRYPTPROTECTMEMORY_SAME_PROCESS)) + if (!GlobalCryptLoader.pCryptProtectMemory(Data,DWORD(Aligned),Flags)) { ErrHandler.GeneralErrMsg(L"CryptProtectMemory failed"); ErrHandler.SysErrMsg(); @@ -180,7 +183,7 @@ { if (GlobalCryptLoader.pCryptUnprotectMemory!=NULL) { - if (!GlobalCryptLoader.pCryptUnprotectMemory(Data,DWORD(Aligned),CRYPTPROTECTMEMORY_SAME_PROCESS)) + if (!GlobalCryptLoader.pCryptUnprotectMemory(Data,DWORD(Aligned),Flags)) { ErrHandler.GeneralErrMsg(L"CryptUnprotectMemory failed"); ErrHandler.SysErrMsg(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/secpassword.hpp new/unrar/secpassword.hpp --- old/unrar/secpassword.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/secpassword.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -22,10 +22,14 @@ bool IsSet() {return PasswordSet;} size_t Length(); bool operator == (SecPassword &psw); + + // Set to true if we need to pass a password to another process. + // We use it when transferring parameters to UAC elevated WinRAR. + bool CrossProcess; }; void cleandata(void *data,size_t size); -void SecHideData(void *Data,size_t DataSize,bool Encode); +void SecHideData(void *Data,size_t DataSize,bool Encode,bool CrossProcess); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/smallfn.cpp new/unrar/smallfn.cpp --- old/unrar/smallfn.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/smallfn.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -4,7 +4,7 @@ { if (N2<N1) return(100); - return(ToPercentUnlim(N1,N2)); + return ToPercentUnlim(N1,N2); } @@ -13,5 +13,7 @@ { if (N2==0) return(0); - return((int)(N1*100/N2)); + return (int)(N1*100/N2); } + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/strfn.cpp new/unrar/strfn.cpp --- old/unrar/strfn.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/strfn.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -265,8 +265,9 @@ char* strncatz(char* dest, const char* src, size_t maxlen) { size_t Length = strlen(dest); - if (Length + 1 < maxlen) - strncat(dest, src, maxlen - Length - 1); + int avail=int(maxlen - Length - 1); + if (avail > 0) + strncat(dest, src, avail); return dest; } @@ -277,8 +278,9 @@ wchar* wcsncatz(wchar* dest, const wchar* src, size_t maxlen) { size_t Length = wcslen(dest); - if (Length + 1 < maxlen) - wcsncat(dest, src, maxlen - Length - 1); + int avail=int(maxlen - Length - 1); + if (avail > 0) + wcsncat(dest, src, avail); return dest; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/timefn.hpp new/unrar/timefn.hpp --- old/unrar/timefn.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/timefn.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -32,6 +32,7 @@ RarTime& operator =(time_t ut); time_t GetUnix(); bool operator == (RarTime &rt) {return itime==rt.itime;} + bool operator != (RarTime &rt) {return itime!=rt.itime;} bool operator < (RarTime &rt) {return itime<rt.itime;} bool operator <= (RarTime &rt) {return itime<rt.itime || itime==rt.itime;} bool operator > (RarTime &rt) {return itime>rt.itime;} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/ui.hpp new/unrar/ui.hpp --- old/unrar/ui.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/ui.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -45,7 +45,7 @@ UIMSG_SECTORRECOVERED, UIMSG_SECTORNOTRECOVERED, UIMSG_FOUND, UIMSG_CORRECTINGNAME, UIMSG_BADARCHIVE, UIMSG_CREATING, UIMSG_RENAMING, UIMSG_RECVOLCALCCHECKSUM, UIMSG_RECVOLFOUND, UIMSG_RECVOLMISSING, - UIMSG_MISSINGVOL, UIMSG_RECONSTRUCTING, UIMSG_CHECKSUM, + UIMSG_MISSINGVOL, UIMSG_RECONSTRUCTING, UIMSG_CHECKSUM, UIMSG_FAT32SIZE, UIWAIT_FIRST, UIWAIT_DISKFULLNEXT, UIWAIT_FCREATEERROR, @@ -55,9 +55,8 @@ UIEVENT_DELADDEDSTART, UIEVENT_DELADDEDFILE, UIEVENT_FILESFOUND, UIEVENT_ERASEDISK, UIEVENT_FILESUMSTART, UIEVENT_FILESUMPROGRESS, UIEVENT_FILESUMEND, UIEVENT_PROTECTSTART, UIEVENT_PROTECTEND, - UIEVENT_TESTADDEDSTART, UIEVENT_TESTADDEDEND, UIEVENT_RRTESTING, - UIEVENT_NEWARCHIVE, UIEVENT_NEWREVFILE - + UIEVENT_TESTADDEDSTART, UIEVENT_TESTADDEDEND, UIEVENT_RRTESTINGSTART, + UIEVENT_RRTESTINGEND, UIEVENT_NEWARCHIVE, UIEVENT_NEWREVFILE }; // Flags for uiAskReplace function. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/uiconsole.cpp new/unrar/uiconsole.cpp --- old/unrar/uiconsole.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/uiconsole.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -1,8 +1,20 @@ // Purely user interface function. Gets and returns user input. UIASKREP_RESULT uiAskReplace(wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags) { + wchar SizeText1[20],DateStr1[50],SizeText2[20],DateStr2[50]; + + FindData ExistingFD; + memset(&ExistingFD,0,sizeof(ExistingFD)); // In case find fails. + FindFile::FastFind(Name,&ExistingFD); + 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); + bool AllowRename=(Flags & UIASKREP_F_NORENAME)==0; - eprintf(St(MFileExists),Name); int Choice=0; do { @@ -299,11 +311,14 @@ case UIMSG_CHECKSUM: mprintf(St(MCRCFailed),Str[0]); break; + case UIMSG_FAT32SIZE: + mprintf(St(MFAT32Size)); + mprintf(L" "); // For progress percent. + break; - - case UIEVENT_RRTESTING: + case UIEVENT_RRTESTINGSTART: mprintf(L"%s ",St(MTestingRR)); break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/unicode.cpp new/unrar/unicode.cpp --- old/unrar/unicode.cpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/unicode.cpp 2014-10-05 20:17:48.000000000 +0200 @@ -482,21 +482,27 @@ } -uint atoiw(const wchar *s) +int atoiw(const wchar *s) { - return (uint)atoilw(s); + return (int)atoilw(s); } -uint64 atoilw(const wchar *s) +int64 atoilw(const wchar *s) { - uint64 n=0; + int sign=1; + if (*s=='-') + { + s++; + sign=-1; + } + int64 n=0; while (*s>='0' && *s<='9') { n=n*10+(*s-'0'); s++; } - return n; + return sign*n; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/unicode.hpp new/unrar/unicode.hpp --- old/unrar/unicode.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/unicode.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -22,8 +22,8 @@ #endif int toupperw(int ch); int tolowerw(int ch); -uint atoiw(const wchar *s); -uint64 atoilw(const wchar *s); +int atoiw(const wchar *s); +int64 atoilw(const wchar *s); #ifdef DBCS_SUPPORTED class SupportDBCS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/version.hpp new/unrar/version.hpp --- old/unrar/version.hpp 2014-08-06 16:00:15.000000000 +0200 +++ new/unrar/version.hpp 2014-10-05 20:17:48.000000000 +0200 @@ -1,6 +1,6 @@ #define RARVER_MAJOR 5 -#define RARVER_MINOR 11 +#define RARVER_MINOR 20 #define RARVER_BETA 1 #define RARVER_DAY 6 -#define RARVER_MONTH 8 +#define RARVER_MONTH 10 #define RARVER_YEAR 2014 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org