From 6885bd29547d375af764e0f180c4d6aadb735c57 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 28 Mar 2023 13:43:33 +0200 Subject: [PATCH] Windream: Handle unc paths in NormalizePath --- Windream/Windream.vb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Windream/Windream.vb b/Windream/Windream.vb index 71bcec9e..c2380c38 100644 --- a/Windream/Windream.vb +++ b/Windream/Windream.vb @@ -849,8 +849,16 @@ Public Class Windream If IsPathRooted(oNormalizedPath) Then ' This breaks because it converts the path "\SomeFolder" into "C:\SomeFolder" LOL 'oNormalizedPath = GetFullPath(oNormalizedPath) - ' Lets just be pragmatic here - oNormalizedPath = oNormalizedPath.Replace("\\", "\") + + ' 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("\\", "\") + End If + + ' Replace forward slashes oNormalizedPath = oNormalizedPath.Replace("/", "\") _logger.Debug("Path after converting slashes: [{0}]", oNormalizedPath)