From 5ed80c753f1022575c7a31a0bedebaeb5889ce86 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 18 Mar 2022 10:07:59 +0100 Subject: [PATCH] File fixes. --- Penumbra.GameData/ByteString/Utf8GamePath.cs | 5 ++--- Penumbra.GameData/ByteString/Utf8RelPath.cs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Penumbra.GameData/ByteString/Utf8GamePath.cs b/Penumbra.GameData/ByteString/Utf8GamePath.cs index b0d1778f..afd5d12b 100644 --- a/Penumbra.GameData/ByteString/Utf8GamePath.cs +++ b/Penumbra.GameData/ByteString/Utf8GamePath.cs @@ -70,8 +70,7 @@ public readonly struct Utf8GamePath : IEquatable< Utf8GamePath >, IComparable< U return true; } - var substring = s!.Replace( '\\', '/' ); - substring.TrimStart( '/' ); + var substring = s!.Replace( '\\', '/' ).TrimStart( '/' ); if( substring.Length > MaxGamePathLength ) { return false; @@ -99,7 +98,7 @@ public readonly struct Utf8GamePath : IEquatable< Utf8GamePath >, IComparable< U return false; } - var substring = file.FullName[ baseDir.FullName.Length.. ]; + var substring = file.FullName[ ( baseDir.FullName.Length + 1 ).. ]; return FromString( substring, out path, toLower ); } diff --git a/Penumbra.GameData/ByteString/Utf8RelPath.cs b/Penumbra.GameData/ByteString/Utf8RelPath.cs index d0259cc4..f9321944 100644 --- a/Penumbra.GameData/ByteString/Utf8RelPath.cs +++ b/Penumbra.GameData/ByteString/Utf8RelPath.cs @@ -37,8 +37,7 @@ public readonly struct Utf8RelPath : IEquatable< Utf8RelPath >, IComparable< Utf return true; } - var substring = s!.Replace( '/', '\\' ); - substring.TrimStart( '\\' ); + var substring = s!.Replace( '/', '\\' ).TrimStart('\\'); if( substring.Length > MaxRelPathLength ) { return false;