mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Limit the number of file types to attempt to parse as archive
This commit is contained in:
@@ -54,6 +54,8 @@ namespace SabreTools
|
||||
_logger = new Logger(false, "datfromdir.log");
|
||||
_logger.Start();
|
||||
|
||||
Remapping.CreateArchiveFormats();
|
||||
|
||||
// First things first, take care of all of the arguments that this could have
|
||||
_noMD5 = false; _noSHA1 = false; _forceunzip = false; _allfiles = false; _old = false;
|
||||
_name = ""; _desc = ""; _cat = ""; _version = ""; _author = "";
|
||||
@@ -289,7 +291,7 @@ namespace SabreTools
|
||||
DirectoryInfo di = Directory.CreateDirectory(_tempDir);
|
||||
|
||||
bool encounteredErrors = true;
|
||||
if (!_allfiles)
|
||||
if (!_allfiles && Remapping.ArchiveFormats.Contains(Path.GetExtension(item).ToLowerInvariant()))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -28,6 +28,9 @@ namespace SabreTools.Helper
|
||||
public static Dictionary<string, int> PCE = new Dictionary<string, int>();
|
||||
public static Dictionary<string, int> SNES = new Dictionary<string, int>();
|
||||
|
||||
// Available archive formats
|
||||
public static List<string> ArchiveFormats = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Create all remappings to be used by the program
|
||||
/// </summary>
|
||||
@@ -226,5 +229,12 @@ namespace SabreTools.Helper
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateArchiveFormats()
|
||||
{
|
||||
ArchiveFormats.Add("7z");
|
||||
ArchiveFormats.Add("zip");
|
||||
ArchiveFormats.Add("rar");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user