File fixes.

This commit is contained in:
Ottermandias 2022-03-18 10:07:59 +01:00
parent 0ba0c6d057
commit 5ed80c753f
2 changed files with 3 additions and 5 deletions

View file

@ -70,8 +70,7 @@ public readonly struct Utf8GamePath : IEquatable< Utf8GamePath >, IComparable< U
return true; return true;
} }
var substring = s!.Replace( '\\', '/' ); var substring = s!.Replace( '\\', '/' ).TrimStart( '/' );
substring.TrimStart( '/' );
if( substring.Length > MaxGamePathLength ) if( substring.Length > MaxGamePathLength )
{ {
return false; return false;
@ -99,7 +98,7 @@ public readonly struct Utf8GamePath : IEquatable< Utf8GamePath >, IComparable< U
return false; return false;
} }
var substring = file.FullName[ baseDir.FullName.Length.. ]; var substring = file.FullName[ ( baseDir.FullName.Length + 1 ).. ];
return FromString( substring, out path, toLower ); return FromString( substring, out path, toLower );
} }

View file

@ -37,8 +37,7 @@ public readonly struct Utf8RelPath : IEquatable< Utf8RelPath >, IComparable< Utf
return true; return true;
} }
var substring = s!.Replace( '/', '\\' ); var substring = s!.Replace( '/', '\\' ).TrimStart('\\');
substring.TrimStart( '\\' );
if( substring.Length > MaxRelPathLength ) if( substring.Length > MaxRelPathLength )
{ {
return false; return false;