Windream: Handle unc paths in NormalizePath

This commit is contained in:
Jonathan Jenne 2023-03-28 13:43:33 +02:00
parent 4a221a9e1d
commit 6885bd2954

View File

@ -849,8 +849,16 @@ Public Class Windream
If IsPathRooted(oNormalizedPath) Then If IsPathRooted(oNormalizedPath) Then
' This breaks because it converts the path "\SomeFolder" into "C:\SomeFolder" LOL ' This breaks because it converts the path "\SomeFolder" into "C:\SomeFolder" LOL
'oNormalizedPath = GetFullPath(oNormalizedPath) 'oNormalizedPath = GetFullPath(oNormalizedPath)
' Lets just be pragmatic here
' If path is a UNC path, exclude the first double backslashes while replacing
If oNormalizedPath.StartsWith("\\") Then
_logger.Debug("Path looks like a UNC Path")
oNormalizedPath = "\\" & oNormalizedPath.Substring(2).Replace("\\", "\")
Else
oNormalizedPath = oNormalizedPath.Replace("\\", "\") oNormalizedPath = oNormalizedPath.Replace("\\", "\")
End If
' Replace forward slashes
oNormalizedPath = oNormalizedPath.Replace("/", "\") oNormalizedPath = oNormalizedPath.Replace("/", "\")
_logger.Debug("Path after converting slashes: [{0}]", oNormalizedPath) _logger.Debug("Path after converting slashes: [{0}]", oNormalizedPath)