mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Check if root path ended with directory separator
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user