diff --git a/SabreTools.DatTools/DatFileTool.cs b/SabreTools.DatTools/DatFileTool.cs index 9b9615ab..90768a5e 100644 --- a/SabreTools.DatTools/DatFileTool.cs +++ b/SabreTools.DatTools/DatFileTool.cs @@ -44,8 +44,12 @@ namespace SabreTools.DatTools string filename = inputs[newItem.Source.Index].CurrentPath; string rootpath = inputs[newItem.Source.Index].ParentPath; - if (!string.IsNullOrWhiteSpace(rootpath)) + if (!string.IsNullOrWhiteSpace(rootpath) + && !rootpath.EndsWith(Path.DirectorySeparatorChar) + && !rootpath.EndsWith(Path.AltDirectorySeparatorChar)) + { rootpath += Path.DirectorySeparatorChar.ToString(); + } filename = filename.Remove(0, rootpath.Length); newItem.Machine.Name = Path.GetDirectoryName(filename) + Path.DirectorySeparatorChar