From: Marcos Henrich Date: Sat, 30 Jan 2016 11:55:17 +0000 (+0000) Subject: Unix paths fix X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=10270723c370adab32ba554ab30d0f81173b4f2d;p=mono.git Unix paths fix DiscoveryClientProtocol.GetRelativePath was harcoded to use '\\'. Fixes #36116 --- diff --git a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs index de45dfdd88f..aafe6f1c776 100644 --- a/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs +++ b/mcs/class/referencesource/System.Web.Services/System/Web/Services/Discovery/DiscoveryClientProtocol.cs @@ -453,15 +453,15 @@ namespace System.Web.Services.Discovery { while (currentDir.Length > 0) { if (currentDir.Length <= fullPath.Length && string.Compare(currentDir, fullPath.Substring(0, currentDir.Length), StringComparison.OrdinalIgnoreCase) == 0) { answer += fullPath.Substring(currentDir.Length); - if (answer.StartsWith("\\", StringComparison.Ordinal)) + if (answer.StartsWith(""+Path.DirectorySeparatorChar, StringComparison.Ordinal)) answer = answer.Substring(1); return answer; } - answer += "..\\"; + answer += ".." + Path.DirectorySeparatorChar; if (currentDir.Length < 2) break; else { - int lastSlash = currentDir.LastIndexOf('\\', currentDir.Length - 2); + int lastSlash = currentDir.LastIndexOf(Path.DirectorySeparatorChar, currentDir.Length - 2); currentDir = currentDir.Substring(0, lastSlash + 1); } }