Allow searching contents of .gz, .tar, and .rar archives

not .tar.gz though, it thinks it's a nested archive and that's disallowed
somewhere else
This commit is contained in:
YoshiRulz 2020-05-26 14:08:10 +10:00
parent 7ae94c4300
commit 6e9539157e
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 8 deletions

View File

@ -1,5 +1,6 @@
#nullable enable
using System;
using System.IO;
using System.Linq;
@ -25,18 +26,12 @@ namespace BizHawk.Client.Common
try
{
using var arcTest = ArchiveFactory.Open(fileName);
switch (arcTest.Type)
{
case ArchiveType.Zip:
case ArchiveType.SevenZip:
return true;
}
}
catch
{
// ignored
return false;
}
return false;
return true; // no exception? good enough
}
public SharpCompressArchiveFile Construct(string path) => new SharpCompressArchiveFile(path);