[DatFile, SimpleSort, FileTools] Make sure extensions are checked properly

This commit is contained in:
Matt Nadareski
2016-09-26 17:36:25 -07:00
parent f7e47d3cac
commit 219d6f7664
3 changed files with 12 additions and 4 deletions

View File

@@ -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();
}