diff options
author | 2015-06-03 13:50:05 +0000 | |
---|---|---|
committer | 2015-06-03 13:52:04 +0000 | |
commit | 2464526d5632ef33e3660110a36dbd618e448062 (patch) | |
tree | 87d0e3061cf042438e11d12b7fd98efacf3cbd24 /src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java | |
parent | d07eced71c0972817d065b2db92af2fe47e39bae (diff) |
Ignore relative entries in SearchPath.
--
MOS_MIGRATED_REVID=95102460
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java b/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java index 8bb59b98ff..14bbbf1245 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/SearchPath.java @@ -29,6 +29,7 @@ public class SearchPath { /** * Parses a $PATH value into a list of paths. A Null search path is treated as an empty one. + * Relative entries in $PATH are ignored. */ public static List<Path> parse(FileSystem fs, @Nullable String searchPath) { List<Path> paths = new ArrayList<>(); @@ -36,7 +37,11 @@ public class SearchPath { return paths; } for (String p : SEPARATOR.split(searchPath)) { - paths.add(fs.getPath(p)); + PathFragment pf = new PathFragment(p); + + if (pf.isAbsolute()) { + paths.add(fs.getPath(pf)); + } } return paths; } |