Use U8StringBuilder instead of PathBuilder

This commit is contained in:
Alex Barney 2020-03-14 23:22:34 -07:00
parent 7b4df4671c
commit 0c6447daac

View file

@ -360,16 +360,14 @@ namespace LibHac.FsService
FsPath fullPath; FsPath fullPath;
unsafe { _ = &fullPath; } // workaround for CS0165 unsafe { _ = &fullPath; } // workaround for CS0165
var pathBuilder = new PathBuilder(fullPath.Str); var sb = new U8StringBuilder(fullPath.Str);
Result rc = pathBuilder.Append(path); sb.Append(path)
if (rc.IsFailure()) return rc; .Append(new[] { (byte)'d', (byte)'a', (byte)'t', (byte)'a', (byte)'/' });
rc = pathBuilder.Append(new[] { (byte)'d', (byte)'a', (byte)'t', (byte)'a', (byte)'/' }); if (sb.Overflowed)
if (rc.IsFailure()) return rc; return ResultFs.TooLongPath.Log();
pathBuilder.Terminate(); Result rc = FsCreators.TargetManagerFileSystemCreator.GetCaseSensitivePath(out bool success, fullPath.Str);
rc = FsCreators.TargetManagerFileSystemCreator.GetCaseSensitivePath(out bool success, fullPath.Str);
if (rc.IsFailure()) return rc; if (rc.IsFailure()) return rc;
// Reopen the host filesystem as case sensitive // Reopen the host filesystem as case sensitive