aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2016-05-18 14:09:43 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-05-19 16:26:53 +0000
commitcceeac6e009c856452adb2bb3adfa2663138e5ae (patch)
tree4711521afa44595258b95a5ee9cf67d881c19990 /src/main/java
parent102a9a101a52f4ca92c9e97387ae159e54e87b05 (diff)
Fix Windows issue in Path.getRelative, which wasn't handling backslashes.
-- MOS_MIGRATED_REVID=122627792
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/Path.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/Path.java b/src/main/java/com/google/devtools/build/lib/vfs/Path.java
index 03eb36d921..c6245b0e65 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/Path.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/Path.java
@@ -658,7 +658,9 @@ public class Path implements Comparable<Path>, Serializable {
return this;
} else if (path.equals("..")) {
return parent == null ? this : parent;
- } else if ((path.indexOf('/') != -1)) {
+ } else if (path.indexOf('/') != -1) {
+ return getRelative(new PathFragment(path));
+ } else if (path.indexOf(PathFragment.EXTRA_SEPARATOR_CHAR) != -1) {
return getRelative(new PathFragment(path));
} else {
return getCachedChildPath(path);