diff -up unrar-5.4.5/arcread.cpp unrar-5.4-5/arcread.cpp --- unrar-5.4.5/arcread.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/arcread.cpp 2016-12-22 11:29:05 +1000 @@ -1291,7 +1291,7 @@ void Archive::ConvertFileHeader(FileHead hd->FileAttr=0x20; #ifdef _WIN_ALL - if (hd->HSType==HSYS_UNIX) // Convert Unix, OS X and Android decomposed chracters to Windows precomposed. + if (hd->HSType==HSYS_UNIX) // Convert Unix, OS X and Android decomposed characters to Windows precomposed. ConvertToPrecomposed(hd->FileName,ASIZE(hd->FileName)); #endif diff -up unrar-5.4.5/cmddata.cpp unrar-5.4-5/cmddata.cpp --- unrar-5.4.5/cmddata.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/cmddata.cpp 2016-12-22 12:35:05 +1000 @@ -1097,9 +1097,14 @@ bool CommandData::CheckArgs(StringList * // "dirmask\*". It is important for operations other than archiving // with -x. When archiving with -x, directory matched by "dirmask\" // is excluded from further scanning. + // [jmh] Exception: "*\" should only exclude directories, never files. if (DirMask) + { + if (*CurMask=='*' && CurMask[2]==0) + return false; wcsncatz(CurMask,L"*",ASIZE(CurMask)); + } } #ifndef SFX_MODULE @@ -1287,7 +1292,7 @@ void CommandData::ProcessCommand() case 'V': case 'L': ListArchive(this); - break; + return; default: OutHelp(RARX_USERERROR); #endif diff -up unrar-5.4.5/list.cpp unrar-5.4-5/list.cpp --- unrar-5.4.5/list.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/list.cpp 2016-12-22 11:29:05 +1000 @@ -37,8 +37,9 @@ void ListArchive(CommandData *Cmd) bool TitleShown=false; if (!Bare) { - Arc.ViewComment(); - mprintf(L"\n%s: %s",St(MListArchive),Arc.FileName); + if (ArcCount != 0 || !Cmd->DisableCopyright) + mprintf(L"\n"); + mprintf(L"%s: %s",St(MListArchive),Arc.FileName); mprintf(L"\n%s: ",St(MListDetails)); uint SetCount=0; const wchar *Fmt=Arc.Format==RARFMT14 ? L"RAR 1.4":(Arc.Format==RARFMT15 ? L"RAR 4":L"RAR 5"); @@ -65,6 +66,7 @@ void ListArchive(CommandData *Cmd) if (Arc.Encrypted) mprintf(L"%s%s", SetCount++ > 0 ? L", ":L"", St(MListEncHead)); mprintf(L"\n"); + Arc.ViewComment(); } wchar VolNumText[50]; @@ -124,15 +126,15 @@ void ListArchive(CommandData *Cmd) if (Verbose) { - mprintf(L"\n----------- --------- -------- ----- ---------- ----- -------- ----"); - mprintf(L"\n%21ls %9ls %3d%% %-27ls %u",UnpSizeText, + mprintf(L"\n--------- ---- -------- ----- ---------- ----- ----"); + mprintf(L"\n%9ls %9ls %3d%% %-17ls %4u",UnpSizeText, PackSizeText,ToPercentUnlim(TotalPackSize,TotalUnpSize), VolNumText,FileCount); } else { mprintf(L"\n----------- --------- ---------- ----- ----"); - mprintf(L"\n%21ls %-16ls %u",UnpSizeText,VolNumText,FileCount); + mprintf(L"\n%21ls %-16ls %4u",UnpSizeText,VolNumText,FileCount); } SumFileCount+=FileCount; @@ -174,10 +176,10 @@ void ListArchive(CommandData *Cmd) itoa(SumPackSize,PackSizeText,ASIZE(PackSizeText)); if (Verbose) - mprintf(L"%21ls %9ls %3d%% %28ls %u",UnpSizeText,PackSizeText, + mprintf(L"\n%9ls %9ls %3d%% %18ls %4u\n",UnpSizeText,PackSizeText, ToPercentUnlim(SumPackSize,SumUnpSize),L"",SumFileCount); else - mprintf(L"%21ls %18s %lu",UnpSizeText,L"",SumFileCount); + mprintf(L"\n%21ls %18s %4u\n",UnpSizeText,L"",SumFileCount); } } @@ -203,7 +205,7 @@ void ListFileHeader(Archive &Arc,FileHea if (Verbose) { mprintf(L"\n%ls",St(MListTitleV)); - mprintf(L"\n----------- --------- -------- ----- ---------- ----- -------- ----"); + mprintf(L"\n--------- ---- -------- ----- ---------- ----- ----"); } else { @@ -383,27 +385,15 @@ void ListFileHeader(Archive &Arc,FileHea return; } - mprintf(L"\n%c%10ls %9ls ",hd.Encrypted ? '*' : ' ',AttrStr,UnpSizeText); if (Verbose) - mprintf(L"%9ls %4ls ",PackSizeText,RatioStr); - - mprintf(L" %ls ",DateStr); + mprintf(L"\n%9ls %cm%d%c %9ls %4ls ",UnpSizeText,hd.Encrypted ? '*' : ' ', + hd.Method,(hd.Flags & LHD_WINDOWMASK)<=6*32 ? ((hd.Flags&LHD_WINDOWMASK)>>5)+'a':' ', + PackSizeText,RatioStr); + else + mprintf(L"\n%c%10ls %9ls ",hd.Encrypted ? '*' : ' ',AttrStr,UnpSizeText); - if (Verbose) - { - if (hd.FileHash.Type==HASH_CRC32) - mprintf(L"%8.8X ",hd.FileHash.CRC32); - else - if (hd.FileHash.Type==HASH_BLAKE2) - { - byte *S=hd.FileHash.Digest; - mprintf(L"%02x%02x..%02x ",S[0],S[1],S[31]); - } - else - mprintf(L"???????? "); - } - mprintf(L"%ls",Name); + mprintf(L" %ls %ls",DateStr,Name); } /* diff -up unrar-5.4.5/loclang.hpp unrar-5.4-5/loclang.hpp --- unrar-5.4.5/loclang.hpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/loclang.hpp 2016-12-22 11:29:05 +1000 @@ -7,7 +7,7 @@ #define MCopyright L"\nRAR %s Copyright (c) 1993-%d Alexander Roshal %d %s %d" #define MRegTo L"\nRegistered to %s\n" #define MShare L"\nTrial version Type RAR -? for help\n" -#define MUCopyright L"\nUNRAR %s freeware Copyright (c) 1993-%d Alexander Roshal\n" +#define MUCopyright L"UNRAR %s freeware Copyright (c) 1993-%d Alexander Roshal\n" #define MBeta L"beta" #define Mx86 L"x86" #define Mx64 L"x64" @@ -206,8 +206,8 @@ #define MAddAnalyze L"\nAnalyzing archived files: " #define MRepacking L"\nRepacking archived files: " #define MCRCFailed L"\n%-20s - checksum error" -#define MExtrTest L"\n\nTesting archive %s\n" -#define MExtracting L"\n\nExtracting from %s\n" +#define MExtrTest L"Testing archive %s\n" +#define MExtracting L"Extracting from %s\n" #define MUseCurPsw L"\n%s - use current password ?" #define MCreatDir L"\nCreating %-56s" #define MExtrSkipFile L"\nSkipping %-56s" @@ -253,7 +253,7 @@ #define MListEnc L"encrypted" #define MListEncHead L"encrypted headers" #define MListTitleL L" Attributes Size Date Time Name" -#define MListTitleV L" Attributes Size Packed Ratio Date Time Checksum Name" +#define MListTitleV L" Size Meth Packed Ratio Date Time Name" #define MListName L"Name" #define MListType L"Type" #define MListFile L"File" diff -up unrar-5.4.5/pathfn.cpp unrar-5.4-5/pathfn.cpp --- unrar-5.4.5/pathfn.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/pathfn.cpp 2016-12-22 11:29:05 +1000 @@ -947,7 +947,7 @@ bool GetWinLongPath(const wchar *Src,wch } -// Convert Unix, OS X and Android decomposed chracters to Windows precomposed. +// Convert Unix, OS X and Android decomposed characters to Windows precomposed. void ConvertToPrecomposed(wchar *Name,size_t NameSize) { wchar FileName[NM]; diff -up unrar-5.4.5/rar.cpp unrar-5.4-5/rar.cpp --- unrar-5.4.5/rar.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/rar.cpp 2016-12-22 11:29:05 +1000 @@ -36,6 +36,12 @@ int main(int argc, char *argv[]) { CommandData *Cmd=new CommandData; + if (argc==2 && strcmp(argv[1], "--version")==0) + { + Cmd->OutTitle(); + delete Cmd; + return 0; + } #ifdef SFX_MODULE wcscpy(Cmd->Command,L"X"); char *Switch=argc>1 ? argv[1]:NULL; diff -up unrar-5.4.5/timefn.cpp unrar-5.4-5/timefn.cpp --- unrar-5.4.5/timefn.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/timefn.cpp 2016-12-22 11:29:05 +1000 @@ -269,7 +269,20 @@ void RarTime::GetText(wchar *DateStr,siz RarLocalTime lt; GetLocal(<); if (FullMS) - swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u:%02u,%03u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute,lt.Second,lt.Reminder/10000); + { + static wchar dp[4]; + if (*dp==0) + { +#ifdef _UNIX + *dp = *localeconv()->decimal_point; +#elif defined(_WIN_ALL) + GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, dp, ASIZE(dp)); +#endif + if (*dp==0) + *dp=','; + } + swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u:%02u%c%03u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute,lt.Second,*dp,lt.Reminder/10000); + } else swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute); } diff -up unrar-5.4.5/uiconsole.cpp unrar-5.4-5/uiconsole.cpp --- unrar-5.4.5/uiconsole.cpp 2016-08-15 05:17:47 +1000 +++ unrar-5.4-5/uiconsole.cpp 2016-12-22 11:29:05 +1000 @@ -54,7 +54,11 @@ UIASKREP_RESULT uiAskReplace(wchar *Name void uiStartArchiveExtract(bool Extract,const wchar *ArcName) { + static int newline; + if (newline) + mprintf(L"\n\n"); mprintf(St(Extract ? MExtracting : MExtrTest), ArcName); + newline = true; }