Skip to content

Commit

Permalink
[BF04] Backported fix 6e49432
Browse files Browse the repository at this point in the history
Made NeutralizePath() normalize the path in special cases
  • Loading branch information
AptiviCEO committed Aug 22, 2023
1 parent 81130b8 commit 7baf3e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Kernel Simulator/Files/Filesystem.vb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Public Module Filesystem
Path = Manipulation.ReplaceLastOccurrence(Path, CurrDir, "")
End If
End If
Path = IO.Path.GetFullPath(Path).Replace("\", "/")

'If strict, checks for existence of file
If Strict Then
Expand All @@ -263,7 +264,7 @@ Public Module Filesystem
''' <param name="Path">Target path, be it a file or a folder</param>
''' <param name="Source">Source path in which the target is found. Must be a directory</param>
''' <returns>Absolute path</returns>
Public Function NeutralizePath(ByVal Path As String, ByVal Source As String, Optional ByVal Strict As Boolean = False)
Public Function NeutralizePath(ByVal Path As String, ByVal Source As String, Optional ByVal Strict As Boolean = False) As String
#If NTFSCorruptionFix Then
ThrowOnInvalidPath(Path)
ThrowOnInvalidPath(Source)
Expand All @@ -288,6 +289,7 @@ Public Module Filesystem
Path = Manipulation.ReplaceLastOccurrence(Path, Source, "")
End If
End If
Path = IO.Path.GetFullPath(Path).Replace("\", "/")

'If strict, checks for existence of file
If Strict Then
Expand Down

0 comments on commit 7baf3e4

Please sign in to comment.