[ArchiveTools, DatFile] Ensure output filenames are legal

This commit is contained in:
Matt Nadareski
2016-11-01 15:50:32 -07:00
parent dd3768cbbb
commit 6d5217355e
2 changed files with 4 additions and 3 deletions

View File

@@ -898,7 +898,7 @@ namespace SabreTools.Helper.Tools
}
// Get the output archive name from the first rebuild rom
string archiveFileName = Path.Combine(outDir, roms[0].Machine.Name + (roms[0].Machine.Name.EndsWith(".tar") ? "" : ".tar"));
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(roms[0].Machine.Name) + (roms[0].Machine.Name.EndsWith(".tar") ? "" : ".tar"));
// Set internal variables
Stream tarstream = new MemoryStream();
@@ -1224,7 +1224,7 @@ namespace SabreTools.Helper.Tools
}
// Get the output archive name from the first rebuild rom
string archiveFileName = Path.Combine(outDir, roms[0].Machine.Name + (roms[0].Machine.Name.EndsWith(".zip") ? "" : ".zip"));
string archiveFileName = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(roms[0].Machine.Name) + (roms[0].Machine.Name.EndsWith(".zip") ? "" : ".zip"));
// Set internal variables
Stream writeStream = null;