Skip to content

Commit

Permalink
unrar 7.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharlie committed Dec 9, 2023
1 parent cb950f2 commit ca4bd0c
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 44 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif()

set(UNRAR_VERSION_MAJOR 7)
set(UNRAR_VERSION_MINOR 0)
set(UNRAR_VERSION_PATCH 3)
set(UNRAR_VERSION_PATCH 4)
set(PACKAGE_VERSION "${UNRAR_VERSION_MAJOR}.${UNRAR_VERSION_MINOR}.${UNRAR_VERSION_PATCH}")

string(TOLOWER "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" UNRAR_ARCH_NAME)
Expand Down
32 changes: 20 additions & 12 deletions unrar/cmdfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,28 @@ bool CommandData::CheckArgs(StringList *Args,bool Dir,const std::wstring &CheckN
}
else
{
// This code doesn't allow to apply -n and -x wildcard masks without
// trailing slash to folders unless these masks are * and *.*.
// See the changes history below.
// 2023.03.26: Previously we removed this code completely to let
// -npath\* include empty folders in 'path' too. But then we received
// an email from user not willing -x*.avi to exclude folders like
// dir.avi with non-avi files. Also rar.txt mentions that masks like
// *.avi exclude only files. Initially we wanted masks like -npath\*
// or -xpath\* to match the entire contents of path including empty
// folders and added the special check for "*" and "*.*".
// But this is not very straightforward, when *.* and *.avi are
// processed differently, especially taking into account that
// we can specify the exact folder name without wildcards to process
// it and masks like 'dir*\' can be used to exclude folders.
// So we decided to skip all usual wildcard masks for folders.
// 'rar a arc dir -ndir\path\*' include empty folders in 'path' too.
// But then we received an email from user not willing -x*.avi to
// exclude folders like dir.avi with non-avi files. Also rar.txt
// mentions that masks like *.avi exclude only files. Initially
// we wanted masks like -npath\* or -xpath\* to match the entire
// contents of path including empty folders and added the special
// check for "*" and "*.*". But this is not very straightforward,
// when *.* and *.avi are processed differently, especially taking
// into account that we can specify the exact folder name without
// wildcards to process it and masks like 'dir*\' can be used to
// exclude folders. So we decided to skip all usual wildcard masks
// for folders.
// 2023.11.22: We returned the special check for "*" and "*.*",
// because users expected 'rar a arc dir -xdir\*' to exclude
// everything including subfolders in 'dir'. For now we returned it
// both for -n and -x, but we can limit it to -x only if needed.
std::wstring Name=PointToName(CurMask);
if (IsWildcard(Name)/* && wcscmp(Name,L"*")!=0 && wcscmp(Name,L"*.*")!=0*/)
if (IsWildcard(Name) && Name!=L"*" && Name!=L"*.*")
continue;
}
}
Expand Down
8 changes: 4 additions & 4 deletions unrar/dll.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <commctrl.h>

VS_VERSION_INFO VERSIONINFO
FILEVERSION 7, 0, 1, 1043
PRODUCTVERSION 7, 0, 1, 1043
FILEVERSION 7, 0, 2, 1058
PRODUCTVERSION 7, 0, 2, 1058
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
Expand All @@ -14,8 +14,8 @@ FILETYPE VFT_APP
VALUE "CompanyName", "Alexander Roshal\0"
VALUE "ProductName", "RAR decompression library\0"
VALUE "FileDescription", "RAR decompression library\0"
VALUE "FileVersion", "7.0.1\0"
VALUE "ProductVersion", "7.0.1\0"
VALUE "FileVersion", "7.0.2\0"
VALUE "ProductVersion", "7.0.2\0"
VALUE "LegalCopyright", "Copyright \xA9 Alexander Roshal 1993-2023\0"
VALUE "OriginalFilename", "Unrar.dll\0"
}
Expand Down
2 changes: 1 addition & 1 deletion unrar/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ void ListFileHeader(Archive &Arc,FileHeader &hd,bool &TitleShown,bool Verbose,bo
mprintf(L"%02x%02x..%02x ",S[0],S[1],S[31]);
}
else
mprintf(L"???????? ");
mprintf(hd.Dir ? L" ":L"???????? "); // Missing checksum is ok for folder, not for file.
}
mprintf(L"%ls",Name);
}
Expand Down
3 changes: 2 additions & 1 deletion unrar/loclang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
#define MDictOutMem L"\nNot enough memory for %d MB compression dictionary, changed to %d MB."
#define MUseSmalllerDict L"\nPlease use a smaller compression dictionary."
#define MExtrDictOutMem L"\nNot enough memory to unpack the archive with %u GB compression dictionary."
#define MSuggest64bit L"\n64 bit RAR version is necessary."
#define MSuggest64bit L"\n64-bit RAR version is necessary."
#define MOpenErrAtime L"\nYou may need to remove -tsp switch to open this file."
#define MErrReadInfo L"\nChoose 'Ignore' to continue with the already read file part only, 'Ignore all' to do it for all read errors, 'Retry' to repeat read and 'Quit' to abort."
#define MErrReadTrunc L"\n%s is archived incompletely because of read error.\n"
Expand All @@ -402,3 +402,4 @@
#define MDictNotAllowed L"\n%u GB dictionary exceeds %u GB limit and needs more than %u GB memory to unpack."
#define MDictExtrAnyway L"\nUse -md%ug or -mdx%ug switches to extract anyway."
#define MDictComprLimit L"\n%u GB dictionary exceeds %u GB limit and not allowed when compressing data."
#define MNeedSFX64 L"\n64-bit self-extracting module is necessary for %u GB compression dictionary."
2 changes: 1 addition & 1 deletion unrar/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Linux using GCC
CXX=c++
CXXFLAGS=-march=native -O2 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else
CXXFLAGS=-march=native -O2 -std=c++11 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else
LIBFLAGS=-fPIC
DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP
STRIP=strip
Expand Down
27 changes: 14 additions & 13 deletions unrar/pathfn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ static void GenArcName(std::wstring &ArcName,const std::wstring &GenerateMask,ui
Pos++; // Skip '+' in the beginning of time mask.
}

std::wstring Mask=!GenerateMask.empty() ? GenerateMask:L"yyyymmddhhmmss";
std::wstring Mask=!GenerateMask.empty() ? GenerateMask.substr(Pos):L"yyyymmddhhmmss";

bool QuoteMode=false;
uint MAsMinutes=0; // By default we treat 'M' as months.
Expand Down Expand Up @@ -870,18 +870,19 @@ static void GenArcName(std::wstring &ArcName,const std::wstring &GenerateMask,ui
if (StartWeekDay%7>=4)
CurWeek++;

char Field[10][11];

sprintf(Field[0],"%04u",rlt.Year);
sprintf(Field[1],"%02u",rlt.Month);
sprintf(Field[2],"%02u",rlt.Day);
sprintf(Field[3],"%02u",rlt.Hour);
sprintf(Field[4],"%02u",rlt.Minute);
sprintf(Field[5],"%02u",rlt.Second);
sprintf(Field[6],"%02u",(uint)CurWeek);
sprintf(Field[7],"%u",(uint)WeekDay+1);
sprintf(Field[8],"%03u",rlt.yDay+1);
sprintf(Field[9],"%05u",ArcNumber);
const size_t FieldSize=11;
char Field[10][FieldSize];

snprintf(Field[0],FieldSize,"%04u",rlt.Year);
snprintf(Field[1],FieldSize,"%02u",rlt.Month);
snprintf(Field[2],FieldSize,"%02u",rlt.Day);
snprintf(Field[3],FieldSize,"%02u",rlt.Hour);
snprintf(Field[4],FieldSize,"%02u",rlt.Minute);
snprintf(Field[5],FieldSize,"%02u",rlt.Second);
snprintf(Field[6],FieldSize,"%02u",(uint)CurWeek);
snprintf(Field[7],FieldSize,"%u",(uint)WeekDay+1);
snprintf(Field[8],FieldSize,"%03u",rlt.yDay+1);
snprintf(Field[9],FieldSize,"%05u",ArcNumber);

const wchar *MaskChars=L"YMDHISWAEN";

Expand Down
4 changes: 4 additions & 0 deletions unrar/rardefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@

#define MAXCMTSIZE 0x40000

#ifdef _WIN_32
#define DefSFXName L"default32.sfx"
#else
#define DefSFXName L"default.sfx"
#endif
#define DefSortListName L"rarfiles.lst"

// Maximum dictionary allowed by compression. Can be less than
Expand Down
2 changes: 1 addition & 1 deletion unrar/scantree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SCAN_CODE ScanTree::GetNext(FindData *FD)
if (FindCode==SCAN_DONE && GetNextMask())
continue;
if (FilterList.ItemsCount()>0 && FindCode==SCAN_SUCCESS)
if (!CommandData::CheckArgs(&FilterList,FD->IsDir,FD->Name.c_str(),false,MATCH_WILDSUBPATH))
if (!CommandData::CheckArgs(&FilterList,FD->IsDir,FD->Name,false,MATCH_WILDSUBPATH))
continue;
break;
}
Expand Down
17 changes: 9 additions & 8 deletions unrar/ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ enum UIMESSAGE_CODE {
UIERROR_NOFILESTOADD, UIERROR_NOFILESTODELETE, UIERROR_NOFILESTOEXTRACT,
UIERROR_MISSINGVOL, UIERROR_NEEDPREVVOL, UIERROR_UNKNOWNEXTRA,
UIERROR_CORRUPTEXTRA, UIERROR_NTFSREQUIRED, UIERROR_ZIPVOLSFX,
UIERROR_FILERO, UIERROR_TOOLARGESFX, UIERROR_NOZIPSFX, UIERROR_EMAIL,
UIERROR_ACLGET, UIERROR_ACLBROKEN, UIERROR_ACLUNKNOWN, UIERROR_ACLSET,
UIERROR_STREAMBROKEN, UIERROR_STREAMUNKNOWN, UIERROR_INCOMPATSWITCH,
UIERROR_PATHTOOLONG, UIERROR_DIRSCAN, UIERROR_UOWNERGET,
UIERROR_UOWNERBROKEN, UIERROR_UOWNERGETOWNERID, UIERROR_UOWNERGETGROUPID,
UIERROR_UOWNERSET, UIERROR_ULINKREAD, UIERROR_ULINKEXIST,
UIERROR_OPENPRESERVEATIME, UIERROR_READERRTRUNCATED, UIERROR_READERRCOUNT,
UIERROR_DIRNAMEEXISTS,UIERROR_TRUNCPSW,UIERROR_ADJUSTVALUE,
UIERROR_FILERO, UIERROR_TOOLARGESFX, UIERROR_NOZIPSFX, UIERROR_NEEEDSFX64,
UIERROR_EMAIL, UIERROR_ACLGET, UIERROR_ACLBROKEN, UIERROR_ACLUNKNOWN,
UIERROR_ACLSET, UIERROR_STREAMBROKEN, UIERROR_STREAMUNKNOWN,
UIERROR_INCOMPATSWITCH, UIERROR_PATHTOOLONG, UIERROR_DIRSCAN,
UIERROR_UOWNERGET, UIERROR_UOWNERBROKEN, UIERROR_UOWNERGETOWNERID,
UIERROR_UOWNERGETGROUPID, UIERROR_UOWNERSET, UIERROR_ULINKREAD,
UIERROR_ULINKEXIST, UIERROR_OPENPRESERVEATIME, UIERROR_READERRTRUNCATED,
UIERROR_READERRCOUNT, UIERROR_DIRNAMEEXISTS,UIERROR_TRUNCPSW,
UIERROR_ADJUSTVALUE,

UIMSG_FIRST,
UIMSG_STRING, UIMSG_BUILD, UIMSG_RRSEARCH, UIMSG_ANALYZEFILEDATA,
Expand Down
4 changes: 2 additions & 2 deletions unrar/version.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define RARVER_MAJOR 7
#define RARVER_MINOR 0
#define RARVER_BETA 1
#define RARVER_DAY 8
#define RARVER_BETA 2
#define RARVER_DAY 23
#define RARVER_MONTH 11
#define RARVER_YEAR 2023

0 comments on commit ca4bd0c

Please sign in to comment.