diff -urp 1900-3/C/7zVersion.h 1900-4/C/7zVersion.h --- 1900-3/C/7zVersion.h 2020-03-10 16:33:01 +1000 +++ 1900-4/C/7zVersion.h 2020-03-11 12:13:01 +1000 @@ -2,7 +2,7 @@ #define MY_VER_MINOR 00 #define MY_VER_BUILD 0 #define MY_VERSION_NUMBERS "19.00" -#define MY_VERSION MY_VERSION_NUMBERS "a2" +#define MY_VERSION MY_VERSION_NUMBERS "a3" #ifdef MY_CPU_NAME #define MY_VERSION_CPU MY_VERSION " (" MY_CPU_NAME ")" @@ -10,7 +10,7 @@ #define MY_VERSION_CPU MY_VERSION #endif -#define MY_DATE "2020-03-04" +#define MY_DATE "2020-03-11" #undef MY_COPYRIGHT #undef MY_VERSION_COPYRIGHT_DATE #define MY_AUTHOR_NAME "Igor Pavlov" diff -urp 1900-3/C/7zVersion.rc 1900-4/C/7zVersion.rc --- 1900-3/C/7zVersion.rc 2020-03-10 16:33:01 +1000 +++ 1900-4/C/7zVersion.rc 2020-03-10 17:56:02 +1000 @@ -11,7 +11,7 @@ #include "7zVersion.h" #endif -#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,3 +#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,4 #ifdef DEBUG #define DBG_FL VS_FF_DEBUG diff -urp 1900-3/CPP/7zip/Archive/Nsis/NsisIn.cpp 1900-4/CPP/7zip/Archive/Nsis/NsisIn.cpp --- 1900-3/CPP/7zip/Archive/Nsis/NsisIn.cpp 2020-03-10 16:33:01 +1000 +++ 1900-4/CPP/7zip/Archive/Nsis/NsisIn.cpp 2020-03-11 12:37:44 +1000 @@ -3344,6 +3344,9 @@ HRESULT CInArchive::ReadEntries(const CB kVar_Spec_OUTDIR_225 : kVar_Spec_OUTDIR; + CUIntVector outdir_stack; + AString outdir_suffix; + for (kkk = 0; kkk < bh.Num; kkk++, p += kCmdSize) { UInt32 commandId; @@ -3543,7 +3546,12 @@ HRESULT CInArchive::ReadEntries(const CB if (idx == (Int32)spec_outdir_VarIndex) Raw_AString.Insert(0, spec_outdir_A); else if (idx == kVar_OUTDIR) - Raw_AString.Insert(0, APrefixes.Back()); + { + if (outdir_suffix.IsEmpty()) + Raw_AString.Insert(0, APrefixes.Back()); + else + Raw_AString.Insert(0, outdir_suffix); + } APrefixes.Add(Raw_AString); } } @@ -3576,6 +3584,17 @@ HRESULT CInArchive::ReadEntries(const CB spec_outdir_A = APrefixes.Back(); // outdir_A; } } + else if (params[0] == kVar_OUTDIR && !IsUnicode) + { + ReadString2_Raw(params[1]); + if (Raw_AString.IsPrefixedBy("$OUTDIR")) + { + outdir_stack.Add(outdir_suffix.Len()); + if (outdir_suffix.IsEmpty()) + outdir_suffix = APrefixes[0]; + outdir_suffix += Raw_AString.Mid(7, Raw_AString.Len()); + } + } #ifdef NSIS_SCRIPT @@ -4250,6 +4269,11 @@ HRESULT CInArchive::ReadEntries(const CB { s += "Pop"; AddParam_Var(params[0]); + if (params[0] == kVar_OUTDIR && !outdir_stack.IsEmpty()) + { + outdir_suffix.DeleteFrom(outdir_stack.Back()); + outdir_stack.DeleteBack(); + } } else { diff -urp 1900-3/CPP/7zip/UI/Common/ArchiveCommandLine.cpp 1900-4/CPP/7zip/UI/Common/ArchiveCommandLine.cpp --- 1900-3/CPP/7zip/UI/Common/ArchiveCommandLine.cpp 2020-03-10 16:33:01 +1000 +++ 1900-4/CPP/7zip/UI/Common/ArchiveCommandLine.cpp 2020-03-10 17:52:27 +1000 @@ -39,7 +39,6 @@ extern bool g_CaseSensitive; extern bool g_PathTrailReplaceMode; -extern bool g_ArchiveWildcards; #ifdef _7ZIP_LARGE_PAGES bool g_LargePagesMode = false; @@ -372,6 +371,8 @@ static bool ParseArchiveCommand(const US // ------------------------------------------------------------------ // filenames functions +static bool g_InArchive; + static void AddNameToCensor(NWildcard::CCensor &censor, const UString &name, bool include, NRecursedType::EEnum type, bool wildcardMatching) { @@ -386,7 +387,7 @@ static void AddNameToCensor(NWildcard::C recursed = true; break; } - censor.AddPreItem(include, name, recursed, wildcardMatching); + censor.AddPreItem(include, name, recursed, wildcardMatching, g_InArchive); } static void AddRenamePair(CObjectVector *renamePairs, @@ -1114,7 +1115,7 @@ void CArcCmdLineParser::Parse2(CArcCmdLi bool isExtractOrList = isExtractGroupCommand || options.Command.CommandType == NCommandType::kList || options.Command.CommandType == NCommandType::kProperties; - g_ArchiveWildcards = isExtractOrList; + g_InArchive = isExtractOrList; bool thereAreSwitchIncludes = false; @@ -1167,6 +1168,8 @@ void CArcCmdLineParser::Parse2(CArcCmdLi recursedType, wildcardMatching, thereAreSwitchIncludes, codePage); + g_InArchive = false; + options.YesToAll = parser[NKey::kYes].ThereIs; diff -urp 1900-3/CPP/Common/Wildcard.cpp 1900-4/CPP/Common/Wildcard.cpp --- 1900-3/CPP/Common/Wildcard.cpp 2020-03-10 16:33:02 +1000 +++ 1900-4/CPP/Common/Wildcard.cpp 2020-03-10 17:49:23 +1000 @@ -11,8 +11,6 @@ bool g_CaseSensitive = true; #endif -bool g_ArchiveWildcards; - bool IsPath1PrefixedByPath2(const wchar_t *s1, const wchar_t *s2) { @@ -538,7 +536,7 @@ static unsigned GetNumPrefixParts(const #endif } -void CCensor::AddItem(ECensorPathMode pathMode, bool include, const UString &path, bool recursive, bool wildcardMatching) +void CCensor::AddItem(ECensorPathMode pathMode, bool include, const UString &path, bool recursive, bool wildcardMatching, bool inArchive) { if (path.IsEmpty()) throw "Empty file path"; @@ -554,7 +552,7 @@ void CCensor::AddItem(ECensorPathMode pa } bool matchAtEnd = false; - if (g_ArchiveWildcards) + if (inArchive) { if (pathParts.Front().IsEmpty()) pathParts.Delete(0); @@ -682,18 +680,19 @@ void CCensor::AddPathsToCensor(ECensorPa FOR_VECTOR(i, CensorPaths) { const CCensorPath &cp = CensorPaths[i]; - AddItem(censorPathMode, cp.Include, cp.Path, cp.Recursive, cp.WildcardMatching); + AddItem(censorPathMode, cp.Include, cp.Path, cp.Recursive, cp.WildcardMatching, cp.InArchive); } CensorPaths.Clear(); } -void CCensor::AddPreItem(bool include, const UString &path, bool recursive, bool wildcardMatching) +void CCensor::AddPreItem(bool include, const UString &path, bool recursive, bool wildcardMatching, bool inArchive) { CCensorPath &cp = CensorPaths.AddNew(); cp.Path = path; cp.Include = include; cp.Recursive = recursive; cp.WildcardMatching = wildcardMatching; + cp.InArchive = inArchive; } } diff -urp 1900-3/CPP/Common/Wildcard.h 1900-4/CPP/Common/Wildcard.h --- 1900-3/CPP/Common/Wildcard.h 2020-03-10 16:33:02 +1000 +++ 1900-4/CPP/Common/Wildcard.h 2020-03-10 17:44:15 +1000 @@ -109,6 +109,7 @@ struct CCensorPath bool Include; bool Recursive; bool WildcardMatching; + bool InArchive; CCensorPath(): Include(true), @@ -128,12 +129,12 @@ public: bool AllAreRelative() const { return (Pairs.Size() == 1 && Pairs.Front().Prefix.IsEmpty()); } - void AddItem(ECensorPathMode pathMode, bool include, const UString &path, bool recursive, bool wildcardMatching); + void AddItem(ECensorPathMode pathMode, bool include, const UString &path, bool recursive, bool wildcardMatching, bool inArchive = false); // bool CheckPath(bool isAltStream, const UString &path, bool isFile) const; void ExtendExclude(); void AddPathsToCensor(NWildcard::ECensorPathMode censorPathMode); - void AddPreItem(bool include, const UString &path, bool recursive, bool wildcardMatching); + void AddPreItem(bool include, const UString &path, bool recursive, bool wildcardMatching, bool inArchive = false); void AddPreItem(const UString &path) { AddPreItem(true, path, false, false); diff -urp 1900-3/help/start.htm 1900-4/help/start.htm --- 1900-3/help/start.htm 2020-03-10 18:16:35 +1000 +++ 1900-4/help/start.htm 2020-03-10 18:17:10 +1000 @@ -10,7 +10,7 @@

7-Zip

-

Welcome to 7-Zip 19.00a2

+

Welcome to 7-Zip 19.00a3

7-Zip is a file archiver with a high compression ratio.

The documentation for 7-Zip includes: