File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
truffle/src/com.oracle.truffle.polyglot/src/com/oracle/truffle/polyglot Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1417,6 +1417,8 @@ private static final class CompositeFileSystem implements PolyglotFileSystem {
1417
1417
private final boolean internal ;
1418
1418
private final boolean noAccess ;
1419
1419
private final boolean host ;
1420
+ private final Path thisDirectory ;
1421
+ private final Path parentDirectory ;
1420
1422
private Path currentWorkingDirectory ;
1421
1423
1422
1424
CompositeFileSystem (AbstractPolyglotImpl polyglot , FileSystem fallBackFileSystem , Selector ... delegates ) {
@@ -1435,6 +1437,8 @@ private static final class CompositeFileSystem implements PolyglotFileSystem {
1435
1437
internal = isInternal ;
1436
1438
noAccess = isNoAccess ;
1437
1439
host = isHost ;
1440
+ thisDirectory = fallBackFileSystem .parsePath ("." );
1441
+ parentDirectory = fallBackFileSystem .parsePath (".." );
1438
1442
}
1439
1443
1440
1444
private static void verifyFileSystemsCompatibility (FileSystem main , FileSystem ... others ) {
@@ -1708,10 +1712,9 @@ private Path toNormalizedAbsolutePath(Path path) {
1708
1712
* paths. It's faster to check if the normalization is needed and normalize only
1709
1713
* non-normalized paths.
1710
1714
*/
1711
- private static boolean isNormalized (Path path ) {
1715
+ private boolean isNormalized (Path path ) {
1712
1716
for (Path name : path ) {
1713
- String strName = name .toString ();
1714
- if ("." .equals (strName ) || ".." .equals (strName )) {
1717
+ if (thisDirectory .equals (name ) || parentDirectory .equals (name )) {
1715
1718
return false ;
1716
1719
}
1717
1720
}
You can’t perform that action at this time.
0 commit comments