Skip to content

Commit

Permalink
Added unrar 5.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cataphract committed Jul 17, 2017
1 parent 5402805 commit c6f8765
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 19 deletions.
4 changes: 2 additions & 2 deletions unrar/dll.rc
Expand Up @@ -2,8 +2,8 @@
#include <commctrl.h>

VS_VERSION_INFO VERSIONINFO
FILEVERSION 5, 50, 1, 2297
PRODUCTVERSION 5, 50, 1, 2297
FILEVERSION 5, 50, 1, 2303
PRODUCTVERSION 5, 50, 1, 2303
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
Expand Down
24 changes: 18 additions & 6 deletions unrar/extract.cpp
Expand Up @@ -853,13 +853,25 @@ void CmdExtract::ExtrPrepareName(Archive &Arc,const wchar *ArcFileName,wchar *De
if (ArcPathLength>0)
{
size_t NameLength=wcslen(ArcFileName);
ArcFileName+=Min(ArcPathLength,NameLength);
while (*ArcFileName==CPATHDIVIDER)
ArcFileName++;
if (*ArcFileName==0) // Excessive -ap switch.

// Earlier we compared lengths only here, but then noticed a cosmetic bug
// in WinRAR. When extracting a file reference from subfolder with
// "Extract relative paths", so WinRAR sets ArcPath, if reference target
// is missing, error message removed ArcPath both from reference and target
// names. If target was stored in another folder, its name looked wrong.
if (NameLength>=ArcPathLength &&
wcsnicompc(Cmd->ArcPath,ArcFileName,ArcPathLength)==0 &&
(IsPathDiv(Cmd->ArcPath[ArcPathLength-1]) ||
IsPathDiv(ArcFileName[ArcPathLength]) || ArcFileName[ArcPathLength]==0))
{
*DestName=0;
return;
ArcFileName+=Min(ArcPathLength,NameLength);
while (IsPathDiv(*ArcFileName))
ArcFileName++;
if (*ArcFileName==0) // Excessive -ap switch.
{
*DestName=0;
return;
}
}
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions unrar/match.cpp
Expand Up @@ -128,18 +128,18 @@ bool match(const wchar *pattern,const wchar *string,bool ForceCase)
int mwcsicompc(const wchar *Str1,const wchar *Str2,bool ForceCase)
{
if (ForceCase)
return(wcscmp(Str1,Str2));
return(wcsicompc(Str1,Str2));
return wcscmp(Str1,Str2);
return wcsicompc(Str1,Str2);
}


int mwcsnicompc(const wchar *Str1,const wchar *Str2,size_t N,bool ForceCase)
{
if (ForceCase)
return(wcsncmp(Str1,Str2,N));
return wcsncmp(Str1,Str2,N);
#if defined(_UNIX)
return(wcsncmp(Str1,Str2,N));
return wcsncmp(Str1,Str2,N);
#else
return(wcsnicomp(Str1,Str2,N));
return wcsnicomp(Str1,Str2,N);
#endif
}
2 changes: 1 addition & 1 deletion unrar/rarvm.cpp
Expand Up @@ -25,7 +25,7 @@ void RarVM::Execute(VM_PreparedProgram *Prg)
if (Prg->Type!=VMSF_NONE)
{
ExecuteStandardFilter(Prg->Type);
uint BlockSize=Prg->InitR[4];
uint BlockSize=Prg->InitR[4] & VM_MEMMASK;
Prg->FilteredDataSize=BlockSize;
if (Prg->Type==VMSF_DELTA || Prg->Type==VMSF_RGB || Prg->Type==VMSF_AUDIO)
Prg->FilteredData=2*BlockSize>=VM_MEMSIZE ? Mem:Mem+BlockSize;
Expand Down
16 changes: 13 additions & 3 deletions unrar/strfn.cpp
Expand Up @@ -255,12 +255,22 @@ bool LowAscii(const wchar *Str)
}


int wcsicompc(const wchar *Str1,const wchar *Str2) // For path comparison.
int wcsicompc(const wchar *s1,const wchar *s2) // For path comparison.
{
#if defined(_UNIX)
return wcscmp(Str1,Str2);
return wcscmp(s1,s2);
#else
return wcsicomp(Str1,Str2);
return wcsicomp(s1,s2);
#endif
}


int wcsnicompc(const wchar *s1,const wchar *s2,size_t n)
{
#if defined(_UNIX)
return wcsncmp(s1,s2,n);
#else
return wcsnicomp(s1,s2,n);
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion unrar/strfn.hpp
Expand Up @@ -36,7 +36,8 @@ uint GetDigits(uint Number);
bool LowAscii(const char *Str);
bool LowAscii(const wchar *Str);

int wcsicompc(const wchar *Str1,const wchar *Str2);
int wcsicompc(const wchar *s1,const wchar *s2);
int wcsnicompc(const wchar *s1,const wchar *s2,size_t n);

void itoa(int64 n,char *Str,size_t MaxSize);
void itoa(int64 n,wchar *Str,size_t MaxSize);
Expand Down
2 changes: 1 addition & 1 deletion unrar/version.hpp
@@ -1,6 +1,6 @@
#define RARVER_MAJOR 5
#define RARVER_MINOR 50
#define RARVER_BETA 1
#define RARVER_DAY 12
#define RARVER_DAY 18
#define RARVER_MONTH 4
#define RARVER_YEAR 2017

0 comments on commit c6f8765

Please sign in to comment.