Fix mounted FS adding the mount path instead of removing it

This commit is contained in:
duckdoom4
2023-02-09 11:00:44 +01:00
parent 73fe6e7c83
commit 55415d5864

View File

@@ -11,12 +11,12 @@ public record MountPoint
public FileSystemPath MountPath { get; }
public IFileSystem FileSystem { get; }
public FileSystemPath ToAbsolutePath(FileSystemPath path)
public FileSystemPath AddMountPoint(FileSystemPath path)
{
return MountPath.AppendPath(path);
}
public FileSystemPath ToRelativePath(FileSystemPath path)
public FileSystemPath RemoveMountPoint(FileSystemPath path)
{
return path.IsRoot ? path : path.MakeRelativeTo(MountPath);
}
@@ -24,7 +24,7 @@ public FileSystemPath ToRelativePath(FileSystemPath path)
public MountPoint(FileSystemPath mountPath, IFileSystem fileSystem)
{
MountPath = mountPath;
FileSystem = fileSystem.AsRelativeFileSystem(ToAbsolutePath, ToRelativePath);
FileSystem = fileSystem.AsRelativeFileSystem(RemoveMountPoint, AddMountPoint);
}
}