This is the first time for me to create a 7-Zip patch ticket. I am sorry if something is not suitable.
Some NanaZip users aren't able to extract multi volume rar files properly but WinRAR can handle it properly. (https://github.com/M2Team/NanaZip/issues/82) I have do some discovery and find the 7-Zip have that issue too. I have tried to do some modifications for CPP\7zip\Archive\Rar\RarVol.h and succeed to resolve the issue. I think I should share the way.
Here is the example of the files names for multi volume rar files we aren't able to extract properly.
And we can know there are some complex chars after the volume digit number. But 7-Zip's implementation is only suitable for something like "{Prefix}{Digit}.{Suffix}". I have modify the CVolumeName::InitName method. Here is the snippet.
bool InitName(const UString &name, bool newStyle = true) { _needChangeForNext = true; _after.Empty(); UString base (name); const int dotPos = name.ReverseFind_Dot(); int newPos = dotPos; for (; newPos != 0; newPos--) if (IsDigit(base[newPos - 1])) break; if (dotPos >= 0) { const UString ext (name.Ptr(dotPos + 1)); if (ext.IsEqualTo_Ascii_NoCase("rar")) { _after += name.Ptr(newPos); base.DeleteFrom(newPos); } else if (ext.IsEqualTo_Ascii_NoCase("exe")) { _after += name.Ptr(newPos); base.DeleteFrom(newPos); _after.Replace(L".exe", L".rar"); } else if (!newStyle) { if (ext.IsEqualTo_Ascii_NoCase("000") || ext.IsEqualTo_Ascii_NoCase("001") || ext.IsEqualTo_Ascii_NoCase("r00") || ext.IsEqualTo_Ascii_NoCase("r01")) { _changed = ext; _before = name.Left(dotPos + 1); return true; } } } if (newStyle) { unsigned i = base.Len(); for (; i != 0; i--) if (!IsDigit(base[i - 1])) break; if (i != base.Len()) { _before = base.Left(i); _changed = base.Ptr(i); return true; } } _after.Empty(); _before = base; _before += '.'; _changed = "r00"; _needChangeForNext = false; return true; }
I think it should have more elegant implementation to resolve this issue.
Kenji Mouri
I' ll try to fix it.
Thanks!