From 33c37b7d11b665941ee3aadfd33e1babe3e42fe0 Mon Sep 17 00:00:00 2001 From: Greg Watson Date: Mon, 29 Sep 2014 14:38:24 -0400 Subject: [PATCH] Bug 445149 - Check the authority section when converting a URI to a UNC path Change-Id: If0ee8b57bd938d6a7e8aa755668e3c742c2f8ab2 Signed-off-by: Greg Watson --- .../eclipse/cdt/utils/UNCPathConverter.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/UNCPathConverter.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/UNCPathConverter.java index 783a82a0f9a..c4da0c95a40 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/UNCPathConverter.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/UNCPathConverter.java @@ -65,14 +65,19 @@ public abstract class UNCPathConverter { */ public static IPath toPath(URI uri) { IPath localPath = URIUtil.toPath(uri); - String host = uri.getHost(); - // try local path first - // that'll give EFS a chance to resolve a custom protocol path. - if (host != null && localPath == null) { - return new Path(host + uri.getPath()).makeUNC(true); - } else { + if (localPath != null) { return localPath; - } + } + // see if the uri has an host part + String host = uri.getHost(); + if (host == null) { + // see if the uri has a authority part + host = uri.getAuthority(); + if (host == null) { + return localPath; + } + } + return new Path(host).makeUNC(true).append(uri.getPath()); } /**