Skip to content

Commit c65abe5

Browse files
committed
Avoid relying on bad behaviour of UnionPath
1 parent 4b8147c commit c65abe5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/cpw/mods/niofs/union/UnionFileSystem.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,11 @@ public DirectoryStream<Path> newDirStream(final UnionPath path, final DirectoryS
404404
if (!fastPathExists(dir)) {
405405
continue;
406406
}
407-
final var isSimple = embeddedFileSystems.containsKey(bp);
408407
final var ds = Files.newDirectoryStream(dir, filter);
409408
closeables.add(ds);
410409
final var currentPaths = StreamSupport.stream(ds.spliterator(), false)
411410
.filter(p -> testFilter(p, bp, null))
412-
.map(other -> fastPath(isSimple ? other : bp.relativize(other)))
413-
.map(other -> path.resolve(path.relativize(other)));
411+
.map(other -> path.resolve(fastPath(dir.relativize(other))));
414412
stream = Stream.concat(stream, currentPaths);
415413
}
416414
final Stream<Path> realStream = stream.distinct();

0 commit comments

Comments
 (0)