mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile, SimpleSort, FileTools] Make sure extensions are checked properly
This commit is contained in:
@@ -1189,7 +1189,11 @@ namespace SabreTools.Helper
|
||||
{
|
||||
// Check the file extension first as a safeguard
|
||||
string ext = Path.GetExtension(filename).ToLowerInvariant();
|
||||
if (ext != ".txt" && ext != ".dat" && ext != ".xml")
|
||||
if (ext.StartsWith("."))
|
||||
{
|
||||
ext = ext.Substring(1);
|
||||
}
|
||||
if (ext != "txt" && ext != "dat" && ext != "xml")
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3013,7 +3017,7 @@ namespace SabreTools.Helper
|
||||
if (stats)
|
||||
{
|
||||
StreamWriter sw = new StreamWriter(new MemoryStream());
|
||||
OutputStats(sw, StatOutputFormat.None, logger, (RomCount + DiskCount == 0));
|
||||
OutputStats(sw, StatOutputFormat.None, logger, recalculate: (RomCount + DiskCount == 0), baddumpCol: true, nodumpCol: true);
|
||||
sw.Dispose();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user