From a76077de99a3d1db1668348ff57863607b27875b Mon Sep 17 00:00:00 2001 From: Timerix22 Date: Tue, 4 Apr 2023 23:17:29 +0600 Subject: [PATCH] Path methods fixes --- DTLib/Filesystem/IOPath.cs | 12 ++++++++---- DTLib/Filesystem/Path.cs | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/DTLib/Filesystem/IOPath.cs b/DTLib/Filesystem/IOPath.cs index d06c9ca..421a6d1 100644 --- a/DTLib/Filesystem/IOPath.cs +++ b/DTLib/Filesystem/IOPath.cs @@ -28,12 +28,16 @@ public readonly struct IOPath static string FixSeparators(char[] path) { int length = path.Length; - if (path[path.Length-1]==Path.Sep || path[path.Length-1]==Path.NotSep) + if (path[length-1] == Path.Sep || path[length-1] == Path.NotSep) length--; // removing trailing sep - for(int i=0; i doesnt starts with <{baseDir}"); - return path.Substring(baseDir.Length); + return path.Substring(baseDir.Length+1); } } \ No newline at end of file