[DatFile] Fix outdir handling in diff

This commit is contained in:
Matt Nadareski
2017-06-06 15:20:57 -07:00
parent e43124057c
commit 7e8a8a0342

View File

@@ -505,9 +505,10 @@ namespace SabreTools.Library.Dats
{ {
// If we have an output directory set, replace the path // If we have an output directory set, replace the path
string[] split = inputs[j].Split('¬'); string[] split = inputs[j].Split('¬');
string path = outDir + (split[0] == split[1] string path = Path.Combine(outDir,
? Path.GetFileName(split[0]) (split[0] == split[1]
: (Path.GetDirectoryName(split[0]).Remove(0, split[1].Length))); ? Path.GetFileName(split[0])
: (Path.GetDirectoryName(split[0]).Remove(0, split[1].Length))));
// Try to output the file // Try to output the file
outDats[j].WriteToFile(path); outDats[j].WriteToFile(path);