diff --git a/platform/util/src/com/intellij/util/PathMappingSettings.java b/platform/util/src/com/intellij/util/PathMappingSettings.java index eef0d59abd3b..348dcbfe37ae 100644 --- a/platform/util/src/com/intellij/util/PathMappingSettings.java +++ b/platform/util/src/com/intellij/util/PathMappingSettings.java @@ -345,6 +345,7 @@ public class PathMappingSettings extends AbstractPathMapper implements Cloneable private static boolean canReplaceRemote(@NotNull String path, @NotNull String remotePrefix) { path = norm(path); remotePrefix = norm(remotePrefix); - return path.startsWith(remotePrefix) && (remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/")); + return path.startsWith(remotePrefix) && + (path.length() == remotePrefix.length() || remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/")); } }