mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-11-15 17:02:03 +00:00
Fix split zip parts not found when the .ZIP is uppercase
This commit is contained in:
@@ -21,7 +21,7 @@ internal static class ZipArchiveVolumeFactory
|
||||
part1.DirectoryName!,
|
||||
String.Concat(
|
||||
m.Groups[1].Value,
|
||||
Regex.Replace(m.Groups[2].Value, @"[^xz]", ""),
|
||||
Regex.Replace(m.Groups[2].Value.ToLowerInvariant(), @"[^xz]", ""),
|
||||
index.ToString(Constants.DefaultCultureInfo).PadLeft(2, '0')
|
||||
)
|
||||
)
|
||||
|
||||
@@ -148,6 +148,17 @@ public class ZipArchiveTests : ArchiveTests
|
||||
//uses first part to search for all parts and compares against this array
|
||||
ArchiveGetParts(new[] { "WinZip26.nocomp.multi.zipx", "WinZip26.nocomp.multi.zx01" });
|
||||
|
||||
[Fact]
|
||||
public void Zip_GetParts_UpperCaseZip()
|
||||
{
|
||||
var zip = Path.Combine(SCRATCH2_FILES_PATH, "MULTI.ZIP");
|
||||
var z01 = Path.Combine(SCRATCH2_FILES_PATH, "MULTI.z01");
|
||||
File.Copy(Path.Combine(TEST_ARCHIVES_PATH, "Infozip.nocomp.multi.zip"), zip);
|
||||
File.Copy(Path.Combine(TEST_ARCHIVES_PATH, "Infozip.nocomp.multi.z01"), z01);
|
||||
|
||||
Assert.Equal(new[] { zip, z01 }, ArchiveFactory.GetFileParts(zip));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Zip_GetPartsSplit() =>
|
||||
//uses first part to search for all parts and compares against this array
|
||||
|
||||
Reference in New Issue
Block a user