From 83aecff13bd3e40d9467a735c497ee26f977f4cf Mon Sep 17 00:00:00 2001 From: Davide Giacometti Date: Mon, 15 Apr 2024 18:21:02 +0200 Subject: [PATCH] [PTRun][Folder]Allow UNC starting with // (#32309) --- .../DriveOrSharedFolderTests.cs | 1 + .../Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder.UnitTests/DriveOrSharedFolderTests.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder.UnitTests/DriveOrSharedFolderTests.cs index 12cce1ea39..335dfd835e 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder.UnitTests/DriveOrSharedFolderTests.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder.UnitTests/DriveOrSharedFolderTests.cs @@ -19,6 +19,7 @@ namespace Microsoft.Plugin.Folder.UnitTests [DataTestMethod] [DataRow(@"\\test-server\testdir", true)] + [DataRow(@"//test-server/testdir", true)] [DataRow(@"c:", true)] [DataRow(@"c:\", true)] [DataRow(@"C:\", true)] diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs index afaa1b488e..631d86a242 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Path/FolderHelper.cs @@ -35,7 +35,7 @@ namespace Microsoft.Plugin.Folder.Sources ArgumentNullException.ThrowIfNull(search); // Using Ordinal this is internal and we're comparing symbols - if (search.StartsWith(@"\\", StringComparison.Ordinal)) + if (search.StartsWith(@"\\", StringComparison.Ordinal) || search.StartsWith(@"//", StringComparison.Ordinal)) { // share folder return true; }