From 30752d8c0eb1fa6b12ce02abe4a3677673eea826 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 20 May 2016 23:28:47 -0700 Subject: [PATCH] Base path not being set correctly all the time --- HashSplit/HashSplit.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HashSplit/HashSplit.cs b/HashSplit/HashSplit.cs index 96d11441..b6a7d2b0 100644 --- a/HashSplit/HashSplit.cs +++ b/HashSplit/HashSplit.cs @@ -137,6 +137,9 @@ namespace SabreTools private bool SplitHelper(string filename, string basepath) { + // Sanitize the basepath to be more predictable + basepath = (basepath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? basepath : basepath + Path.DirectorySeparatorChar); + // Get the file data to be split OutputFormat outputFormat = RomManipulation.GetOutputFormat(filename); DatData datdata = new DatData @@ -267,7 +270,7 @@ namespace SabreTools string outdir = ""; if (_outdir != "") { - outdir = _outdir + Path.GetDirectoryName(filename).Remove(0, basepath.Length); + outdir = _outdir + Path.GetDirectoryName(filename).Remove(0, basepath.Length - 1); } else {