Hello community, here is the log from the commit of package unrar for openSUSE:Factory:NonFree checked in at 2019-02-24 17:21:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory:NonFree/unrar (Old) and /work/SRC/openSUSE:Factory:NonFree/.unrar.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "unrar" Sun Feb 24 17:21:15 2019 rev:76 rq:677981 version:5.7.2 Changes: -------- --- /work/SRC/openSUSE:Factory:NonFree/unrar/unrar.changes 2019-02-01 11:49:06.092327219 +0100 +++ /work/SRC/openSUSE:Factory:NonFree/.unrar.new.28833/unrar.changes 2019-02-24 17:21:16.668387735 +0100 @@ -1,0 +2,6 @@ +Thu Feb 21 11:34:43 UTC 2019 - Ismail Dönmez <idon...@suse.com> + +- Update to version 5.7.2 + * No upstream changelog + +------------------------------------------------------------------- Old: ---- unrarsrc-5.7.1.tar.gz New: ---- unrarsrc-5.7.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ unrar.spec ++++++ --- /var/tmp/diff_new_pack.bhsqIZ/_old 2019-02-24 17:21:17.276387627 +0100 +++ /var/tmp/diff_new_pack.bhsqIZ/_new 2019-02-24 17:21:17.280387626 +0100 @@ -18,10 +18,10 @@ # majorversion should match the major version number. %define majorversion 5 -%define libsuffix 5_7_1 +%define libsuffix 5_7_2 Name: unrar -Version: 5.7.1 +Version: 5.7.2 Release: 0 Summary: A program to extract, test, and view RAR archives License: NonFree ++++++ unrarsrc-5.7.1.tar.gz -> unrarsrc-5.7.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/arccmt.cpp new/unrar/arccmt.cpp --- old/unrar/arccmt.cpp 2019-01-28 11:39:40.000000000 +0100 +++ new/unrar/arccmt.cpp 2019-02-21 11:25:08.000000000 +0100 @@ -34,7 +34,7 @@ #ifndef SFX_MODULE // Old style (RAR 2.9) comment header embedded into the main // archive header. - if (BrokenHeader) + if (BrokenHeader || CommHead.HeadSize<SIZEOF_COMMHEAD) { uiMsg(UIERROR_CMTBROKEN,FileName); return false; @@ -57,6 +57,8 @@ #else UnpCmtLength=GetByte(); UnpCmtLength+=(GetByte()<<8); + if (CmtLength<2) + return false; CmtLength-=2; DataIO.SetCmt13Encryption(); CommHead.UnpVer=15; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/cmddata.cpp new/unrar/cmddata.cpp --- old/unrar/cmddata.cpp 2019-01-28 11:39:40.000000000 +0100 +++ new/unrar/cmddata.cpp 2019-02-21 11:25:08.000000000 +0100 @@ -1,5 +1,8 @@ #include "rar.hpp" +#include "cmdfilter.cpp" +#include "cmdmix.cpp" + CommandData::CommandData() { Init(); @@ -130,7 +133,7 @@ FindData FileData; bool Found=FindFile::FastFind(Arg,&FileData); if ((!Found || ListMode==RCLM_ACCEPT_LISTS) && - ListMode!=RCLM_REJECT_LISTS && *Arg=='@' && !IsWildcard(Arg)) + ListMode!=RCLM_REJECT_LISTS && *Arg=='@' && !IsWildcard(Arg+1)) { FileLists=true; @@ -411,9 +414,9 @@ wcsncpyz(LogName,Switch[4]!=0 ? Switch+4:DefLogName,ASIZE(LogName)); break; } - if (wcsicomp(Switch+1,L"SND")==0) + if (wcsnicomp(Switch+1,L"SND",3)==0) { - Sound=true; + Sound=Switch[4]=='-' ? SOUND_NOTIFY_OFF : SOUND_NOTIFY_ON; break; } if (wcsicomp(Switch+1,L"ERR")==0) @@ -809,40 +812,16 @@ ArcTime=ARCTIME_LATEST; break; case 'O': - switch(toupperw(Switch[2])) - { - case 'M': FileMtimeBefore.SetAgeText(Switch+3); break; - case 'C': FileCtimeBefore.SetAgeText(Switch+3); break; - case 'A': FileAtimeBefore.SetAgeText(Switch+3); break; - default: FileMtimeBefore.SetAgeText(Switch+2); break; - } + SetTimeFilters(Switch+2,true,true); break; case 'N': - switch(toupperw(Switch[2])) - { - case 'M': FileMtimeAfter.SetAgeText(Switch+3); break; - case 'C': FileCtimeAfter.SetAgeText(Switch+3); break; - case 'A': FileAtimeAfter.SetAgeText(Switch+3); break; - default: FileMtimeAfter.SetAgeText(Switch+2); break; - } + SetTimeFilters(Switch+2,false,true); break; case 'B': - switch(toupperw(Switch[2])) - { - case 'M': FileMtimeBefore.SetIsoText(Switch+3); break; - case 'C': FileCtimeBefore.SetIsoText(Switch+3); break; - case 'A': FileAtimeBefore.SetIsoText(Switch+3); break; - default: FileMtimeBefore.SetIsoText(Switch+2); break; - } + SetTimeFilters(Switch+2,true,false); break; case 'A': - switch(toupperw(Switch[2])) - { - case 'M': FileMtimeAfter.SetIsoText(Switch+3); break; - case 'C': FileCtimeAfter.SetIsoText(Switch+3); break; - case 'A': FileAtimeAfter.SetIsoText(Switch+3); break; - default: FileMtimeAfter.SetIsoText(Switch+2); break; - } + SetTimeFilters(Switch+2,false,false); break; case 'S': { @@ -950,317 +929,6 @@ #endif -void CommandData::OutTitle() -{ - if (BareOutput || DisableCopyright) - return; -#if defined(__GNUC__) && defined(SFX_MODULE) - mprintf(St(MCopyrightS)); -#else -#ifndef SILENT - static bool TitleShown=false; - if (TitleShown) - return; - TitleShown=true; - - wchar Version[80]; - if (RARVER_BETA!=0) - swprintf(Version,ASIZE(Version),L"%d.%02d %ls %d",RARVER_MAJOR,RARVER_MINOR,St(MBeta),RARVER_BETA); - else - swprintf(Version,ASIZE(Version),L"%d.%02d",RARVER_MAJOR,RARVER_MINOR); -#if defined(_WIN_32) || defined(_WIN_64) - wcsncatz(Version,L" ",ASIZE(Version)); -#endif -#ifdef _WIN_32 - wcsncatz(Version,St(Mx86),ASIZE(Version)); -#endif -#ifdef _WIN_64 - wcsncatz(Version,St(Mx64),ASIZE(Version)); -#endif - if (PrintVersion) - { - mprintf(L"%s",Version); - exit(0); - } - mprintf(St(MUCopyright),Version,RARVER_YEAR); -#endif -#endif -} - - -inline bool CmpMSGID(MSGID i1,MSGID i2) -{ -#ifdef MSGID_INT - return i1==i2; -#else - // If MSGID is const char*, we cannot compare pointers only. - // Pointers to different instances of same string can differ, - // so we need to compare complete strings. - return wcscmp(i1,i2)==0; -#endif -} - -void CommandData::OutHelp(RAR_EXIT ExitCode) -{ -#if !defined(SILENT) - OutTitle(); - static MSGID Help[]={ -#ifdef SFX_MODULE - // Console SFX switches definition. - MCHelpCmd,MSHelpCmdE,MSHelpCmdT,MSHelpCmdV -#else - // UnRAR switches definition. - MUNRARTitle1,MRARTitle2,MCHelpCmd,MCHelpCmdE,MCHelpCmdL, - MCHelpCmdP,MCHelpCmdT,MCHelpCmdV,MCHelpCmdX,MCHelpSw,MCHelpSwm, - MCHelpSwAT,MCHelpSwAC,MCHelpSwAD,MCHelpSwAG,MCHelpSwAI,MCHelpSwAP, - MCHelpSwCm,MCHelpSwCFGm,MCHelpSwCL,MCHelpSwCU, - MCHelpSwDH,MCHelpSwEP,MCHelpSwEP3,MCHelpSwF,MCHelpSwIDP,MCHelpSwIERR, - MCHelpSwINUL,MCHelpSwIOFF,MCHelpSwKB,MCHelpSwN,MCHelpSwNa,MCHelpSwNal, - MCHelpSwO,MCHelpSwOC,MCHelpSwOL,MCHelpSwOR,MCHelpSwOW,MCHelpSwP, - MCHelpSwPm,MCHelpSwR,MCHelpSwRI,MCHelpSwSC,MCHelpSwSL,MCHelpSwSM, - MCHelpSwTA,MCHelpSwTB,MCHelpSwTN,MCHelpSwTO,MCHelpSwTS,MCHelpSwU, - MCHelpSwVUnr,MCHelpSwVER,MCHelpSwVP,MCHelpSwX,MCHelpSwXa,MCHelpSwXal, - MCHelpSwY -#endif - }; - - for (uint I=0;I<ASIZE(Help);I++) - { -#ifndef SFX_MODULE - if (CmpMSGID(Help[I],MCHelpSwV)) - continue; -#ifndef _WIN_ALL - static MSGID Win32Only[]={ - MCHelpSwIEML,MCHelpSwVD,MCHelpSwAO,MCHelpSwOS,MCHelpSwIOFF, - MCHelpSwEP2,MCHelpSwOC,MCHelpSwONI,MCHelpSwDR,MCHelpSwRI - }; - bool Found=false; - for (int J=0;J<sizeof(Win32Only)/sizeof(Win32Only[0]);J++) - if (CmpMSGID(Help[I],Win32Only[J])) - { - Found=true; - break; - } - if (Found) - continue; -#endif -#if !defined(_UNIX) && !defined(_WIN_ALL) - if (CmpMSGID(Help[I],MCHelpSwOW)) - continue; -#endif -#if !defined(_WIN_ALL) && !defined(_EMX) - if (CmpMSGID(Help[I],MCHelpSwAC)) - continue; -#endif -#ifndef SAVE_LINKS - if (CmpMSGID(Help[I],MCHelpSwOL)) - continue; -#endif -#ifndef RAR_SMP - if (CmpMSGID(Help[I],MCHelpSwMT)) - continue; -#endif -#endif - mprintf(St(Help[I])); - } - mprintf(L"\n"); - ErrHandler.Exit(ExitCode); -#endif -} - - -// Return 'true' if we need to exclude the file from processing as result -// of -x switch. If CheckInclList is true, we also check the file against -// the include list created with -n switch. -bool CommandData::ExclCheck(const wchar *CheckName,bool Dir,bool CheckFullPath,bool CheckInclList) -{ - if (CheckArgs(&ExclArgs,Dir,CheckName,CheckFullPath,MATCH_WILDSUBPATH)) - return true; - if (!CheckInclList || InclArgs.ItemsCount()==0) - return false; - if (CheckArgs(&InclArgs,Dir,CheckName,CheckFullPath,MATCH_WILDSUBPATH)) - return false; - return true; -} - - -bool CommandData::CheckArgs(StringList *Args,bool Dir,const wchar *CheckName,bool CheckFullPath,int MatchMode) -{ - wchar *Name=ConvertPath(CheckName,NULL,0); - wchar FullName[NM]; - wchar CurMask[NM]; - *FullName=0; - Args->Rewind(); - while (Args->GetString(CurMask,ASIZE(CurMask))) - { - wchar *LastMaskChar=PointToLastChar(CurMask); - bool DirMask=IsPathDiv(*LastMaskChar); // Mask for directories only. - - if (Dir) - { - // CheckName is a directory. - if (DirMask) - { - // We process the directory and have the directory exclusion mask. - // So let's convert "mask\" to "mask" and process it normally. - - *LastMaskChar=0; - } - else - { - // REMOVED, we want -npath\* to match empty folders too. - // If mask has wildcards in name part and does not have the trailing - // '\' character, we cannot use it for directories. - - // if (IsWildcard(PointToName(CurMask))) - // continue; - } - } - else - { - // If we process a file inside of directory excluded by "dirmask\". - // we want to exclude such file too. So we convert "dirmask\" to - // "dirmask\*". It is important for operations other than archiving - // with -x. When archiving with -x, directory matched by "dirmask\" - // is excluded from further scanning. - - if (DirMask) - wcsncatz(CurMask,L"*",ASIZE(CurMask)); - } - -#ifndef SFX_MODULE - if (CheckFullPath && IsFullPath(CurMask)) - { - // We do not need to do the special "*\" processing here, because - // unlike the "else" part of this "if", now we convert names to full - // format, so they all include the path, which is matched by "*\" - // correctly. Moreover, removing "*\" from mask would break - // the comparison, because now all names have the path. - - if (*FullName==0) - ConvertNameToFull(CheckName,FullName,ASIZE(FullName)); - if (CmpName(CurMask,FullName,MatchMode)) - return true; - } - else -#endif - { - wchar NewName[NM+2],*CurName=Name; - - // Important to convert before "*\" check below, so masks like - // d:*\something are processed properly. - wchar *CmpMask=ConvertPath(CurMask,NULL,0); - - if (CmpMask[0]=='*' && IsPathDiv(CmpMask[1])) - { - // We want "*\name" to match 'name' not only in subdirectories, - // but also in the current directory. We convert the name - // from 'name' to '.\name' to be matched by "*\" part even if it is - // in current directory. - NewName[0]='.'; - NewName[1]=CPATHDIVIDER; - wcsncpyz(NewName+2,Name,ASIZE(NewName)-2); - CurName=NewName; - } - - if (CmpName(CmpMask,CurName,MatchMode)) - return true; - } - } - return false; -} - - -#ifndef SFX_MODULE -// Now this function performs only one task and only in Windows version: -// it skips symlinks to directories if -e1024 switch is specified. -// Symlinks are skipped in ScanTree class, so their entire contents -// is skipped too. Without this function we would check the attribute -// only directly before archiving, so we would skip the symlink record, -// but not the contents of symlinked directory. -bool CommandData::ExclDirByAttr(uint FileAttr) -{ -#ifdef _WIN_ALL - if ((FileAttr & FILE_ATTRIBUTE_REPARSE_POINT)!=0 && - (ExclFileAttr & FILE_ATTRIBUTE_REPARSE_POINT)!=0) - return true; -#endif - return false; -} -#endif - - - - -#ifndef SFX_MODULE -// Return 'true' if we need to exclude the file from processing. -bool CommandData::TimeCheck(RarTime &ftm,RarTime &ftc,RarTime &fta) -{ - if (FileMtimeBefore.IsSet() && ftm>=FileMtimeBefore) - return true; - if (FileMtimeAfter.IsSet() && ftm<=FileMtimeAfter) - return true; - if (FileCtimeBefore.IsSet() && ftc>=FileCtimeBefore) - return true; - if (FileCtimeAfter.IsSet() && ftc<=FileCtimeAfter) - return true; - if (FileAtimeBefore.IsSet() && fta>=FileAtimeBefore) - return true; - if (FileAtimeAfter.IsSet() && fta<=FileAtimeAfter) - return true; - return false; -} -#endif - - -#ifndef SFX_MODULE -// Return 'true' if we need to exclude the file from processing. -bool CommandData::SizeCheck(int64 Size) -{ - if (FileSizeLess!=INT64NDF && Size>=FileSizeLess) - return(true); - if (FileSizeMore!=INT64NDF && Size<=FileSizeMore) - return(true); - return(false); -} -#endif - - - - -int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType, - wchar *MatchedArg,uint MatchedArgSize) -{ - if (MatchedArg!=NULL && MatchedArgSize>0) - *MatchedArg=0; -// if (wcslen(FileHead.FileName)>=NM) -// return 0; - bool Dir=FileHead.Dir; - if (ExclCheck(FileHead.FileName,Dir,false,true)) - return 0; -#ifndef SFX_MODULE - if (TimeCheck(FileHead.mtime,FileHead.ctime,FileHead.atime)) - return 0; - if ((FileHead.FileAttr & ExclFileAttr)!=0 || InclAttrSet && (FileHead.FileAttr & InclFileAttr)==0) - return 0; - if (!Dir && SizeCheck(FileHead.UnpSize)) - return 0; -#endif - wchar *ArgName; - FileArgs.Rewind(); - for (int StringCount=1;(ArgName=FileArgs.GetString())!=NULL;StringCount++) - if (CmpName(ArgName,FileHead.FileName,MatchType)) - { - if (ExactMatch!=NULL) - *ExactMatch=wcsicompc(ArgName,FileHead.FileName)==0; - if (MatchedArg!=NULL) - wcsncpyz(MatchedArg,ArgName,MatchedArgSize); - return StringCount; - } - return 0; -} - - void CommandData::ProcessCommand() { #ifndef SFX_MODULE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/cmddata.hpp new/unrar/cmddata.hpp --- old/unrar/cmddata.hpp 2019-01-28 11:39:40.000000000 +0100 +++ new/unrar/cmddata.hpp 2019-02-21 11:25:08.000000000 +0100 @@ -6,6 +6,8 @@ enum RAR_CMD_LIST_MODE {RCLM_AUTO,RCLM_REJECT_LISTS,RCLM_ACCEPT_LISTS}; +enum IS_PROCESS_FILE_FLAGS {IPFF_EXCLUDE_PARENT=1}; + class CommandData:public RAROptions { private: @@ -13,6 +15,9 @@ void ProcessSwitch(const wchar *Switch); void BadSwitch(const wchar *Switch); uint GetExclAttr(const wchar *Str); +#if !defined(SFX_MODULE) + void SetTimeFilters(const wchar *Mod,bool Before,bool Age); +#endif bool FileLists; bool NoMoreSwitches; @@ -37,8 +42,8 @@ bool TimeCheck(RarTime &ftm,RarTime &ftc,RarTime &fta); bool SizeCheck(int64 Size); bool AnyFiltersActive(); - int IsProcessFile(FileHeader &FileHead,bool *ExactMatch=NULL,int MatchType=MATCH_WILDSUBPATH, - wchar *MatchedArg=NULL,uint MatchedArgSize=0); + int IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType, + bool Flags,wchar *MatchedArg,uint MatchedArgSize); void ProcessCommand(); void AddArcName(const wchar *Name); bool GetArcName(wchar *Name,int MaxSize); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/cmdfilter.cpp new/unrar/cmdfilter.cpp --- old/unrar/cmdfilter.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/unrar/cmdfilter.cpp 2019-02-21 11:25:08.000000000 +0100 @@ -0,0 +1,299 @@ +// Return 'true' if we need to exclude the file from processing as result +// of -x switch. If CheckInclList is true, we also check the file against +// the include list created with -n switch. +bool CommandData::ExclCheck(const wchar *CheckName,bool Dir,bool CheckFullPath,bool CheckInclList) +{ + if (CheckArgs(&ExclArgs,Dir,CheckName,CheckFullPath,MATCH_WILDSUBPATH)) + return true; + if (!CheckInclList || InclArgs.ItemsCount()==0) + return false; + if (CheckArgs(&InclArgs,Dir,CheckName,CheckFullPath,MATCH_WILDSUBPATH)) + return false; + return true; +} + + +bool CommandData::CheckArgs(StringList *Args,bool Dir,const wchar *CheckName,bool CheckFullPath,int MatchMode) +{ + wchar *Name=ConvertPath(CheckName,NULL,0); + wchar FullName[NM]; + wchar CurMask[NM]; + *FullName=0; + Args->Rewind(); + while (Args->GetString(CurMask,ASIZE(CurMask))) + { + wchar *LastMaskChar=PointToLastChar(CurMask); + bool DirMask=IsPathDiv(*LastMaskChar); // Mask for directories only. + + if (Dir) + { + // CheckName is a directory. + if (DirMask) + { + // We process the directory and have the directory exclusion mask. + // So let's convert "mask\" to "mask" and process it normally. + + *LastMaskChar=0; + } + else + { + // REMOVED, we want -npath\* to match empty folders too. + // If mask has wildcards in name part and does not have the trailing + // '\' character, we cannot use it for directories. + + // if (IsWildcard(PointToName(CurMask))) + // continue; + } + } + else + { + // If we process a file inside of directory excluded by "dirmask\". + // we want to exclude such file too. So we convert "dirmask\" to + // "dirmask\*". It is important for operations other than archiving + // with -x. When archiving with -x, directory matched by "dirmask\" + // is excluded from further scanning. + + if (DirMask) + wcsncatz(CurMask,L"*",ASIZE(CurMask)); + } + +#ifndef SFX_MODULE + if (CheckFullPath && IsFullPath(CurMask)) + { + // We do not need to do the special "*\" processing here, because + // unlike the "else" part of this "if", now we convert names to full + // format, so they all include the path, which is matched by "*\" + // correctly. Moreover, removing "*\" from mask would break + // the comparison, because now all names have the path. + + if (*FullName==0) + ConvertNameToFull(CheckName,FullName,ASIZE(FullName)); + if (CmpName(CurMask,FullName,MatchMode)) + return true; + } + else +#endif + { + wchar NewName[NM+2],*CurName=Name; + + // Important to convert before "*\" check below, so masks like + // d:*\something are processed properly. + wchar *CmpMask=ConvertPath(CurMask,NULL,0); + + if (CmpMask[0]=='*' && IsPathDiv(CmpMask[1])) + { + // We want "*\name" to match 'name' not only in subdirectories, + // but also in the current directory. We convert the name + // from 'name' to '.\name' to be matched by "*\" part even if it is + // in current directory. + NewName[0]='.'; + NewName[1]=CPATHDIVIDER; + wcsncpyz(NewName+2,Name,ASIZE(NewName)-2); + CurName=NewName; + } + + if (CmpName(CmpMask,CurName,MatchMode)) + return true; + } + } + return false; +} + + + + +#ifndef SFX_MODULE +// Now this function performs only one task and only in Windows version: +// it skips symlinks to directories if -e1024 switch is specified. +// Symlinks are skipped in ScanTree class, so their entire contents +// is skipped too. Without this function we would check the attribute +// only directly before archiving, so we would skip the symlink record, +// but not the contents of symlinked directory. +bool CommandData::ExclDirByAttr(uint FileAttr) +{ +#ifdef _WIN_ALL + if ((FileAttr & FILE_ATTRIBUTE_REPARSE_POINT)!=0 && + (ExclFileAttr & FILE_ATTRIBUTE_REPARSE_POINT)!=0) + return true; +#endif + return false; +} +#endif + + + + +#if !defined(SFX_MODULE) +void CommandData::SetTimeFilters(const wchar *Mod,bool Before,bool Age) +{ + bool ModeOR=false,TimeMods=false; + const wchar *S=Mod; + for (;wcschr(L"MCAOmcao",*S)!=NULL;S++) + if (*S=='o' || *S=='O') + ModeOR=true; + else + TimeMods=true; + + if (!TimeMods) + Mod=L"m"; + + for (;wcschr(L"MCAOmcao",*Mod)!=NULL;Mod++) + switch(toupperw(*Mod)) + { + case 'M': + if (Before) + { + Age ? FileMtimeBefore.SetAgeText(S):FileMtimeBefore.SetIsoText(S); + FileMtimeBeforeOR=ModeOR; + } + else + { + Age ? FileMtimeAfter.SetAgeText(S):FileMtimeAfter.SetIsoText(S); + FileMtimeAfterOR=ModeOR; + } + break; + case 'C': + if (Before) + { + Age ? FileCtimeBefore.SetAgeText(S):FileCtimeBefore.SetIsoText(S); + FileCtimeBeforeOR=ModeOR; + } + else + { + Age ? FileCtimeAfter.SetAgeText(S):FileCtimeAfter.SetIsoText(S); + FileCtimeAfterOR=ModeOR; + } + break; + case 'A': + if (Before) + { + Age ? FileAtimeBefore.SetAgeText(S):FileAtimeBefore.SetIsoText(S); + FileAtimeBeforeOR=ModeOR; + } + else + { + Age ? FileAtimeAfter.SetAgeText(S):FileAtimeAfter.SetIsoText(S); + FileAtimeAfterOR=ModeOR; + } + break; + } +} +#endif + + +#ifndef SFX_MODULE +// Return 'true' if we need to exclude the file from processing. +bool CommandData::TimeCheck(RarTime &ftm,RarTime &ftc,RarTime &fta) +{ + bool FilterOR=false; + + if (FileMtimeBefore.IsSet()) // Filter present. + if (ftm>=FileMtimeBefore) // Condition not matched. + if (FileMtimeBeforeOR) + FilterOR=true; // Not matched OR filter is present. + else + return true; // Exclude file in AND mode. + else // Condition matched. + if (FileMtimeBeforeOR) + return false; // Include file in OR mode. + + if (FileMtimeAfter.IsSet()) // Filter present. + if (ftm<FileMtimeAfter) // Condition not matched. + if (FileMtimeAfterOR) + FilterOR=true; // Not matched OR filter is present. + else + return true; // Exclude file in AND mode. + else // Condition matched. + if (FileMtimeAfterOR) + return false; // Include file in OR mode. + + if (FileCtimeBefore.IsSet()) // Filter present. + if (ftc>=FileCtimeBefore) // Condition not matched. + if (FileCtimeBeforeOR) + FilterOR=true; // Not matched OR filter is present. + else + return true; // Exclude file in AND mode. + else // Condition matched. + if (FileCtimeBeforeOR) + return false; // Include file in OR mode. + + if (FileCtimeAfter.IsSet()) // Filter present. + if (ftc<FileCtimeAfter) // Condition not matched. + if (FileCtimeAfterOR) + FilterOR=true; // Not matched OR filter is present. + else + return true; // Exclude file in AND mode. + else // Condition matched. + if (FileCtimeAfterOR) + return false; // Include file in OR mode. + + if (FileAtimeBefore.IsSet()) // Filter present. + if (fta>=FileAtimeBefore) // Condition not matched. + if (FileAtimeBeforeOR) + FilterOR=true; // Not matched OR filter is present. + else + return true; // Exclude file in AND mode. + else // Condition matched. + if (FileAtimeBeforeOR) + return false; // Include file in OR mode. + + if (FileAtimeAfter.IsSet()) // Filter present. + if (fta<FileAtimeAfter) // Condition not matched. + if (FileAtimeAfterOR) + FilterOR=true; // Not matched OR filter is present. + else + return true; // Exclude file in AND mode. + else // Condition matched. + if (FileAtimeAfterOR) + return false; // Include file in OR mode. + + return FilterOR; // Exclude if all OR filters are not matched. +} +#endif + + +#ifndef SFX_MODULE +// Return 'true' if we need to exclude the file from processing. +bool CommandData::SizeCheck(int64 Size) +{ + if (FileSizeLess!=INT64NDF && Size>=FileSizeLess) + return true; + if (FileSizeMore!=INT64NDF && Size<=FileSizeMore) + return true; + return false; +} +#endif + + + + +// Return 0 if file must not be processed or a number of matched parameter otherwise. +int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType, + bool Flags,wchar *MatchedArg,uint MatchedArgSize) +{ + if (MatchedArg!=NULL && MatchedArgSize>0) + *MatchedArg=0; + bool Dir=FileHead.Dir; + if (ExclCheck(FileHead.FileName,Dir,false,true)) + return 0; +#ifndef SFX_MODULE + if (TimeCheck(FileHead.mtime,FileHead.ctime,FileHead.atime)) + return 0; + if ((FileHead.FileAttr & ExclFileAttr)!=0 || InclAttrSet && (FileHead.FileAttr & InclFileAttr)==0) + return 0; + if (!Dir && SizeCheck(FileHead.UnpSize)) + return 0; +#endif + wchar *ArgName; + FileArgs.Rewind(); + for (int StringCount=1;(ArgName=FileArgs.GetString())!=NULL;StringCount++) + if (CmpName(ArgName,FileHead.FileName,MatchType)) + { + if (ExactMatch!=NULL) + *ExactMatch=wcsicompc(ArgName,FileHead.FileName)==0; + if (MatchedArg!=NULL) + wcsncpyz(MatchedArg,ArgName,MatchedArgSize); + return StringCount; + } + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/cmdmix.cpp new/unrar/cmdmix.cpp --- old/unrar/cmdmix.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/unrar/cmdmix.cpp 2019-02-21 11:25:08.000000000 +0100 @@ -0,0 +1,118 @@ +void CommandData::OutTitle() +{ + if (BareOutput || DisableCopyright) + return; +#if defined(__GNUC__) && defined(SFX_MODULE) + mprintf(St(MCopyrightS)); +#else +#ifndef SILENT + static bool TitleShown=false; + if (TitleShown) + return; + TitleShown=true; + + wchar Version[80]; + if (RARVER_BETA!=0) + swprintf(Version,ASIZE(Version),L"%d.%02d %ls %d",RARVER_MAJOR,RARVER_MINOR,St(MBeta),RARVER_BETA); + else + swprintf(Version,ASIZE(Version),L"%d.%02d",RARVER_MAJOR,RARVER_MINOR); +#if defined(_WIN_32) || defined(_WIN_64) + wcsncatz(Version,L" ",ASIZE(Version)); +#endif +#ifdef _WIN_32 + wcsncatz(Version,St(Mx86),ASIZE(Version)); +#endif +#ifdef _WIN_64 + wcsncatz(Version,St(Mx64),ASIZE(Version)); +#endif + if (PrintVersion) + { + mprintf(L"%s",Version); + exit(0); + } + mprintf(St(MUCopyright),Version,RARVER_YEAR); +#endif +#endif +} + + +inline bool CmpMSGID(MSGID i1,MSGID i2) +{ +#ifdef MSGID_INT + return i1==i2; +#else + // If MSGID is const char*, we cannot compare pointers only. + // Pointers to different instances of same string can differ, + // so we need to compare complete strings. + return wcscmp(i1,i2)==0; +#endif +} + +void CommandData::OutHelp(RAR_EXIT ExitCode) +{ +#if !defined(SILENT) + OutTitle(); + static MSGID Help[]={ +#ifdef SFX_MODULE + // Console SFX switches definition. + MCHelpCmd,MSHelpCmdE,MSHelpCmdT,MSHelpCmdV +#else + // UnRAR switches definition. + MUNRARTitle1,MRARTitle2,MCHelpCmd,MCHelpCmdE,MCHelpCmdL, + MCHelpCmdP,MCHelpCmdT,MCHelpCmdV,MCHelpCmdX,MCHelpSw,MCHelpSwm, + MCHelpSwAT,MCHelpSwAC,MCHelpSwAD,MCHelpSwAG,MCHelpSwAI,MCHelpSwAP, + MCHelpSwCm,MCHelpSwCFGm,MCHelpSwCL,MCHelpSwCU, + MCHelpSwDH,MCHelpSwEP,MCHelpSwEP3,MCHelpSwF,MCHelpSwIDP,MCHelpSwIERR, + MCHelpSwINUL,MCHelpSwIOFF,MCHelpSwKB,MCHelpSwN,MCHelpSwNa,MCHelpSwNal, + MCHelpSwO,MCHelpSwOC,MCHelpSwOL,MCHelpSwOR,MCHelpSwOW,MCHelpSwP, + MCHelpSwPm,MCHelpSwR,MCHelpSwRI,MCHelpSwSC,MCHelpSwSL,MCHelpSwSM, + MCHelpSwTA,MCHelpSwTB,MCHelpSwTN,MCHelpSwTO,MCHelpSwTS,MCHelpSwU, + MCHelpSwVUnr,MCHelpSwVER,MCHelpSwVP,MCHelpSwX,MCHelpSwXa,MCHelpSwXal, + MCHelpSwY +#endif + }; + + for (uint I=0;I<ASIZE(Help);I++) + { +#ifndef SFX_MODULE + if (CmpMSGID(Help[I],MCHelpSwV)) + continue; +#ifndef _WIN_ALL + static MSGID Win32Only[]={ + MCHelpSwIEML,MCHelpSwVD,MCHelpSwAO,MCHelpSwOS,MCHelpSwIOFF, + MCHelpSwEP2,MCHelpSwOC,MCHelpSwONI,MCHelpSwDR,MCHelpSwRI + }; + bool Found=false; + for (uint J=0;J<ASIZE(Win32Only);J++) + if (CmpMSGID(Help[I],Win32Only[J])) + { + Found=true; + break; + } + if (Found) + continue; +#endif +#if !defined(_UNIX) && !defined(_WIN_ALL) + if (CmpMSGID(Help[I],MCHelpSwOW)) + continue; +#endif +#if !defined(_WIN_ALL) && !defined(_EMX) + if (CmpMSGID(Help[I],MCHelpSwAC)) + continue; +#endif +#ifndef SAVE_LINKS + if (CmpMSGID(Help[I],MCHelpSwOL)) + continue; +#endif +#ifndef RAR_SMP + if (CmpMSGID(Help[I],MCHelpSwMT)) + continue; +#endif +#endif + mprintf(St(Help[I])); + } + mprintf(L"\n"); + ErrHandler.Exit(ExitCode); +#endif +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/dll.cpp new/unrar/dll.cpp --- old/unrar/dll.cpp 2019-01-28 11:39:41.000000000 +0100 +++ new/unrar/dll.cpp 2019-02-21 11:25:09.000000000 +0100 @@ -96,6 +96,8 @@ if (Data->Arc.Volume) r->Flags|=0x01; + if (Data->Arc.MainComment) + r->Flags|=0x02; if (Data->Arc.Locked) r->Flags|=0x04; if (Data->Arc.Solid) @@ -114,17 +116,29 @@ Array<wchar> CmtDataW; if (r->CmtBufSize!=0 && Data->Arc.GetComment(&CmtDataW)) { - Array<char> CmtData(CmtDataW.Size()*4+1); - memset(&CmtData[0],0,CmtData.Size()); - WideToChar(&CmtDataW[0],&CmtData[0],CmtData.Size()-1); - size_t Size=strlen(&CmtData[0])+1; - - r->Flags|=2; - r->CmtState=Size>r->CmtBufSize ? ERAR_SMALL_BUF:1; - r->CmtSize=(uint)Min(Size,r->CmtBufSize); - memcpy(r->CmtBuf,&CmtData[0],r->CmtSize-1); - if (Size<=r->CmtBufSize) - r->CmtBuf[r->CmtSize-1]=0; + if (r->CmtBufW!=NULL) + { + CmtDataW.Push(0); + size_t Size=wcslen(&CmtDataW[0])+1; + + r->CmtState=Size>r->CmtBufSize ? ERAR_SMALL_BUF:1; + r->CmtSize=(uint)Min(Size,r->CmtBufSize); + memcpy(r->CmtBufW,&CmtDataW[0],(r->CmtSize-1)*sizeof(*r->CmtBufW)); + r->CmtBufW[r->CmtSize-1]=0; + } + else + if (r->CmtBuf!=NULL) + { + Array<char> CmtData(CmtDataW.Size()*4+1); + memset(&CmtData[0],0,CmtData.Size()); + WideToChar(&CmtDataW[0],&CmtData[0],CmtData.Size()-1); + size_t Size=strlen(&CmtData[0])+1; + + r->CmtState=Size>r->CmtBufSize ? ERAR_SMALL_BUF:1; + r->CmtSize=(uint)Min(Size,r->CmtBufSize); + memcpy(r->CmtBuf,&CmtData[0],r->CmtSize-1); + r->CmtBuf[r->CmtSize-1]=0; + } } else r->CmtState=r->CmtSize=0; @@ -437,16 +451,16 @@ } -#ifndef RAR_NOCRYPT void PASCAL RARSetPassword(HANDLE hArcData,char *Password) { +#ifndef RAR_NOCRYPT DataSet *Data=(DataSet *)hArcData; wchar PasswordW[MAXPASSWORD]; GetWideName(Password,NULL,PasswordW,ASIZE(PasswordW)); Data->Cmd.Password.Set(PasswordW); cleandata(PasswordW,sizeof(PasswordW)); -} #endif +} int PASCAL RARGetDllVersion() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/dll.def new/unrar/dll.def --- old/unrar/dll.def 2002-08-09 10:40:16.000000000 +0200 +++ new/unrar/dll.def 2008-01-16 17:58:36.000000000 +0100 @@ -5,6 +5,7 @@ RARReadHeader RARReadHeaderEx RARProcessFile + RARProcessFileW RARSetCallback RARSetChangeVolProc RARSetProcessDataProc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/dll.hpp new/unrar/dll.hpp --- old/unrar/dll.hpp 2019-01-28 11:39:41.000000000 +0100 +++ new/unrar/dll.hpp 2019-02-21 11:25:09.000000000 +0100 @@ -1,7 +1,7 @@ #ifndef _UNRAR_DLL_ #define _UNRAR_DLL_ -#pragma pack(1) +#pragma pack(push, 1) #define ERAR_SUCCESS 0 #define ERAR_END_ARCHIVE 10 @@ -151,7 +151,8 @@ UNRARCALLBACK Callback; LPARAM UserData; unsigned int OpFlags; - unsigned int Reserved[27]; + wchar_t *CmtBufW; + unsigned int Reserved[25]; }; enum UNRARCALLBACK_MESSAGES { @@ -183,6 +184,6 @@ } #endif -#pragma pack() +#pragma pack(pop) #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/dll.rc new/unrar/dll.rc --- old/unrar/dll.rc 2019-01-28 11:01:39.000000000 +0100 +++ new/unrar/dll.rc 2019-02-21 11:15:31.000000000 +0100 @@ -2,8 +2,8 @@ #include <commctrl.h> VS_VERSION_INFO VERSIONINFO -FILEVERSION 5, 70, 1, 2955 -PRODUCTVERSION 5, 70, 1, 2955 +FILEVERSION 5, 70, 2, 2979 +PRODUCTVERSION 5, 70, 2, 2979 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.70.1\0" - VALUE "ProductVersion", "5.70.1\0" + VALUE "FileVersion", "5.70.2\0" + VALUE "ProductVersion", "5.70.2\0" VALUE "LegalCopyright", "Copyright � Alexander Roshal 1993-2019\0" VALUE "OriginalFilename", "Unrar.dll\0" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/dll_nocrypt.def new/unrar/dll_nocrypt.def --- old/unrar/dll_nocrypt.def 1970-01-01 01:00:00.000000000 +0100 +++ new/unrar/dll_nocrypt.def 2008-12-01 17:47:42.000000000 +0100 @@ -0,0 +1,13 @@ +EXPORTS + RAROpenArchive + RAROpenArchiveEx + RARCloseArchive + RARReadHeader + RARReadHeaderEx + RARProcessFile + RARProcessFileW + RARSetCallback + RARSetChangeVolProc + RARSetProcessDataProc +; RARSetPassword + RARGetDllVersion diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/extract.cpp new/unrar/extract.cpp --- old/unrar/extract.cpp 2019-01-28 11:39:41.000000000 +0100 +++ new/unrar/extract.cpp 2019-02-21 11:25:09.000000000 +0100 @@ -87,7 +87,7 @@ FirstFile=true; #endif - GlobalPassword=Cmd->Password.IsSet(); + GlobalPassword=Cmd->Password.IsSet() || uiIsGlobalPasswordSet(); DataIO.UnpVolume=false; @@ -298,7 +298,7 @@ bool EqualNames=false; wchar MatchedArg[NM]; - int MatchNumber=Cmd->IsProcessFile(Arc.FileHead,&EqualNames,MatchType,MatchedArg,ASIZE(MatchedArg)); + int MatchNumber=Cmd->IsProcessFile(Arc.FileHead,&EqualNames,MatchType,0,MatchedArg,ASIZE(MatchedArg)); bool MatchFound=MatchNumber!=0; #ifndef SFX_MODULE if (Cmd->ExclPath==EXCL_BASEPATH) @@ -473,7 +473,7 @@ memcmp(Arc.FileHead.PswCheck,PswCheck,SIZE_PSWCHECK)!=0 && !Arc.BrokenHeader) { - if (GlobalPassword) // For -p<pwd> or Ctrl+P. + if (GlobalPassword) // For -p<pwd> or Ctrl+P to avoid the infinite loop. { // This message is used by Android GUI to reset cached passwords. // Update appropriate code if changed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/list.cpp new/unrar/list.cpp --- old/unrar/list.cpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/list.cpp 2019-02-21 11:25:10.000000000 +0100 @@ -91,7 +91,7 @@ switch(HeaderType) { case HEAD_FILE: - FileMatched=Cmd->IsProcessFile(Arc.FileHead)!=0; + FileMatched=Cmd->IsProcessFile(Arc.FileHead,NULL,MATCH_WILDSUBPATH,0,NULL,0)!=0; if (FileMatched) { ListFileHeader(Arc,Arc.FileHead,TitleShown,Verbose,Technical,Bare); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/loclang.hpp new/unrar/loclang.hpp --- old/unrar/loclang.hpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/loclang.hpp 2019-02-21 11:25:10.000000000 +0100 @@ -85,7 +85,7 @@ #define MCHelpSwILOG L"\n ilog[name] Log errors to file" #define MCHelpSwINUL L"\n inul Disable all messages" #define MCHelpSwIOFF L"\n ioff[n] Turn PC off after completing an operation" -#define MCHelpSwISND L"\n isnd Enable sound" +#define MCHelpSwISND L"\n isnd Control notification sounds" #define MCHelpSwIVER L"\n iver Display the version number" #define MCHelpSwK L"\n k Lock archive" #define MCHelpSwKB L"\n kb Keep broken extracted files" @@ -127,10 +127,10 @@ #define MCHelpSwT L"\n t Test files after archiving" #define MCHelpSwTK L"\n tk Keep original archive time" #define MCHelpSwTL L"\n tl Set archive time to latest file" -#define MCHelpSwTN L"\n tn[m,c,a]<t> Process files newer than <t> time" -#define MCHelpSwTO L"\n to[m,c,a]<t> Process files older than <t> time" -#define MCHelpSwTA L"\n ta[m,c,a]<d> Process files modified after <d> YYYYMMDDHHMMSS date" -#define MCHelpSwTB L"\n tb[m,c,a]<d> Process files modified before <d> YYYYMMDDHHMMSS date" +#define MCHelpSwTN L"\n tn[mcao]<t> Process files newer than <t> time" +#define MCHelpSwTO L"\n to[mcao]<t> Process files older than <t> time" +#define MCHelpSwTA L"\n ta[mcao]<d> Process files modified after <d> YYYYMMDDHHMMSS date" +#define MCHelpSwTB L"\n tb[mcao]<d> Process files modified before <d> YYYYMMDDHHMMSS date" #define MCHelpSwTS L"\n ts[m,c,a] Save or restore file time (modification, creation, access)" #define MCHelpSwU L"\n u Update files" #define MCHelpSwV L"\n v Create volumes with size autodetection or list all volumes" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/match.cpp new/unrar/match.cpp --- old/unrar/match.cpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/match.cpp 2019-02-21 11:25:11.000000000 +0100 @@ -25,10 +25,10 @@ if (CmpMode!=MATCH_NAMES) { size_t WildLength=wcslen(Wildcard); - if (CmpMode!=MATCH_EXACT && CmpMode!=MATCH_EXACTPATH && + if (CmpMode!=MATCH_EXACT && CmpMode!=MATCH_EXACTPATH && CmpMode!=MATCH_ALLWILD && mwcsnicompc(Wildcard,Name,WildLength,ForceCase)==0) { - // For all modes except MATCH_NAMES, MATCH_EXACT and MATCH_EXACTPATH + // For all modes except MATCH_NAMES, MATCH_EXACT, MATCH_EXACTPATH, MATCH_ALLWILD, // "path1" mask must match "path1\path2\filename.ext" and "path1" names. wchar NextCh=Name[WildLength]; if (NextCh==L'\\' || NextCh==L'/' || NextCh==0) @@ -46,6 +46,8 @@ if ((CmpMode==MATCH_EXACT || CmpMode==MATCH_EXACTPATH) && mwcsicompc(Path1,Path2,ForceCase)!=0) return(false); + if (CmpMode==MATCH_ALLWILD) + return match(Wildcard,Name,ForceCase); if (CmpMode==MATCH_SUBPATH || CmpMode==MATCH_WILDSUBPATH) if (IsWildcard(Path1)) return(match(Wildcard,Name,ForceCase)); @@ -64,8 +66,8 @@ // Always return false for RAR temporary files to exclude them // from archiving operations. - if (mwcsnicompc(L"__rar_",Name2,6,false)==0) - return(false); +// if (mwcsnicompc(L"__rar_",Name2,6,false)==0) +// return(false); if (CmpMode==MATCH_EXACT) return(mwcsicompc(Name1,Name2,ForceCase)==0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/match.hpp new/unrar/match.hpp --- old/unrar/match.hpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/match.hpp 2019-02-21 11:25:11.000000000 +0100 @@ -14,6 +14,10 @@ MATCH_EXACT, // Paths must match exactly. // Names must match exactly. + MATCH_ALLWILD, // Paths and names are compared using wildcards. + // Unlike MATCH_SUBPATH, paths do not match subdirs + // unless a wildcard tells so. + MATCH_EXACTPATH, // Paths must match exactly. // Names are compared using wildcards. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/options.hpp new/unrar/options.hpp --- old/unrar/options.hpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/options.hpp 2019-02-21 11:25:11.000000000 +0100 @@ -69,6 +69,10 @@ POWERMODE_RESTART }; + +// Need "forced off" state to turn off sound in GUI command line. +enum SOUND_NOTIFY_MODE {SOUND_NOTIFY_DEFAULT=0,SOUND_NOTIFY_ON,SOUND_NOTIFY_OFF}; + struct FilterMode { FilterState State; @@ -113,7 +117,7 @@ wchar LogName[NM]; MESSAGE_TYPE MsgStream; - bool Sound; + SOUND_NOTIFY_MODE Sound; OVERWRITE_MODE Overwrite; int Method; HASH_TYPE HashType; @@ -164,12 +168,10 @@ bool SaveStreams; bool SetCompressedAttr; bool IgnoreGeneralAttr; - RarTime FileMtimeBefore; - RarTime FileMtimeAfter; - RarTime FileCtimeBefore; - RarTime FileCtimeAfter; - RarTime FileAtimeBefore; - RarTime FileAtimeAfter; + RarTime FileMtimeBefore,FileCtimeBefore,FileAtimeBefore; + bool FileMtimeBeforeOR,FileCtimeBeforeOR,FileAtimeBeforeOR; + RarTime FileMtimeAfter,FileCtimeAfter,FileAtimeAfter; + bool FileMtimeAfterOR,FileCtimeAfterOR,FileAtimeAfterOR; int64 FileSizeLess; int64 FileSizeMore; bool Lock; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/os.hpp new/unrar/os.hpp --- old/unrar/os.hpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/os.hpp 2019-02-21 11:25:11.000000000 +0100 @@ -32,7 +32,12 @@ #define STRICT 1 #endif +// 'ifndef' check here is needed for unrar.dll header to avoid macro +// re-definition warnings in third party projects. +#ifndef UNICODE #define UNICODE +#endif + #undef WINVER #undef _WIN32_WINNT #define WINVER 0x0501 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/pathfn.cpp new/unrar/pathfn.cpp --- old/unrar/pathfn.cpp 2019-01-28 11:39:42.000000000 +0100 +++ new/unrar/pathfn.cpp 2019-02-21 11:25:11.000000000 +0100 @@ -120,7 +120,14 @@ bool IsWildcard(const wchar *Str) { - return Str==NULL ? false:wcspbrk(Str,L"*?")!=NULL; + if (Str==NULL) + return false; +#ifdef _WIN_ALL + // Not treat the special NTFS \\?\d: path prefix as a wildcard. + if (Str[0]=='\\' && Str[1]=='\\' && Str[2]=='?' && Str[3]=='\\') + Str+=4; +#endif + return wcspbrk(Str,L"*?")!=NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/scantree.cpp new/unrar/scantree.cpp --- old/unrar/scantree.cpp 2019-01-28 11:39:43.000000000 +0100 +++ new/unrar/scantree.cpp 2019-02-21 11:25:12.000000000 +0100 @@ -142,7 +142,12 @@ bool WildcardFound=false; uint FolderWildcardCount=0; uint SlashPos=0; - for (uint I=0;CurMask[I]!=0;I++) + uint StartPos=0; +#ifdef _WIN_ALL // Not treat the special NTFS \\?\d: path prefix as a wildcard. + if (CurMask[0]=='\\' && CurMask[1]=='\\' && CurMask[2]=='?' && CurMask[3]=='\\') + StartPos=4; +#endif + for (uint I=StartPos;CurMask[I]!=0;I++) { if (CurMask[I]=='?' || CurMask[I]=='*') WildcardFound=true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/timefn.cpp new/unrar/timefn.cpp --- old/unrar/timefn.cpp 2019-01-28 11:39:43.000000000 +0100 +++ new/unrar/timefn.cpp 2019-02-21 11:25:13.000000000 +0100 @@ -271,7 +271,7 @@ void RarTime::SetAgeText(const wchar *TimeText) { uint Seconds=0,Value=0; - for (int I=0;TimeText[I]!=0;I++) + for (uint I=0;TimeText[I]!=0;I++) { int Ch=TimeText[I]; if (IsDigit(Ch)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/ui.hpp new/unrar/ui.hpp --- old/unrar/ui.hpp 2019-01-28 11:39:43.000000000 +0100 +++ new/unrar/ui.hpp 2019-02-21 11:25:13.000000000 +0100 @@ -76,7 +76,7 @@ UIASKREP_RESULT uiAskReplace(wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags); UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd,wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags); -void uiInit(bool Sound); +void uiInit(SOUND_NOTIFY_MODE Sound); void uiStartArchiveExtract(bool Extract,const wchar *ArcName); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/uicommon.cpp new/unrar/uicommon.cpp --- old/unrar/uicommon.cpp 2019-01-28 11:39:43.000000000 +0100 +++ new/unrar/uicommon.cpp 2019-02-21 11:25:13.000000000 +0100 @@ -1,8 +1,8 @@ -static bool uiSoundEnabled; +static SOUND_NOTIFY_MODE uiSoundNotify; -void uiInit(bool Sound) +void uiInit(SOUND_NOTIFY_MODE Sound) { - uiSoundEnabled = Sound; + uiSoundNotify = Sound; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/uiconsole.cpp new/unrar/uiconsole.cpp --- old/unrar/uiconsole.cpp 2019-01-28 11:39:43.000000000 +0100 +++ new/unrar/uiconsole.cpp 2019-02-21 11:25:13.000000000 +0100 @@ -370,7 +370,7 @@ void uiAlarm(UIALARM_TYPE Type) { - if (uiSoundEnabled) + if (uiSoundNotify==SOUND_NOTIFY_ON) { static clock_t LastTime=-10; // Negative to always beep first time. if ((MonoClock()-LastTime)/CLOCKS_PER_SEC>5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/unrar/version.hpp new/unrar/version.hpp --- old/unrar/version.hpp 2019-01-28 11:39:44.000000000 +0100 +++ new/unrar/version.hpp 2019-02-21 11:25:14.000000000 +0100 @@ -1,6 +1,6 @@ #define RARVER_MAJOR 5 #define RARVER_MINOR 70 -#define RARVER_BETA 1 -#define RARVER_DAY 28 -#define RARVER_MONTH 1 +#define RARVER_BETA 2 +#define RARVER_DAY 21 +#define RARVER_MONTH 2 #define RARVER_YEAR 2019