summaryrefslogtreecommitdiff
path: root/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lvcs-impl/src/com/intellij/history/core/Paths.java')
-rw-r--r--platform/lvcs-impl/src/com/intellij/history/core/Paths.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/platform/lvcs-impl/src/com/intellij/history/core/Paths.java b/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
index 440fd699ef7d..bd98591b4cb3 100644
--- a/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
+++ b/platform/lvcs-impl/src/com/intellij/history/core/Paths.java
@@ -67,9 +67,18 @@ public class Paths {
}
public static Iterable<String> split(String path) {
- Iterable<String> result = StringUtil.tokenize(path, String.valueOf(DELIM));
- if (path.indexOf(DELIM) == 0) {
- result = ContainerUtil.concat(Collections.singleton(String.valueOf(DELIM)), result);
+ //must be consistent with LocalFileSystemBase.extractRootPath()
+ int prefixLen = 0;
+ if (path.startsWith("//")) {
+ prefixLen = path.indexOf(DELIM, 2);
+ if (prefixLen == -1) prefixLen = path.length();
+ }
+ else if (StringUtil.startsWithChar(path, DELIM)) {
+ prefixLen = 1;
+ }
+ Iterable<String> result = StringUtil.tokenize(path.substring(prefixLen), String.valueOf(DELIM));
+ if (prefixLen > 0) {
+ result = ContainerUtil.concat(Collections.singleton(path.substring(0, prefixLen)), result);
}
return result;
}