[K2] Use real path in LibraryList
Fix `testDirectoryWithRelativePath` in the LV20 branch ^KT-60886 Fixed
This commit is contained in:
committed by
Space Team
parent
a73442f90f
commit
a5b530d505
+3
-3
@@ -60,11 +60,11 @@ abstract class LibraryPathFilter {
|
||||
override fun accepts(path: Path?): Boolean {
|
||||
if (path == null) return false
|
||||
val isPathAbsolute = path.isAbsolute
|
||||
val absolutePath by lazy(LazyThreadSafetyMode.NONE) { path.toAbsolutePath() }
|
||||
val realPath by lazy(LazyThreadSafetyMode.NONE) { path.toRealPath() }
|
||||
return libs.any {
|
||||
when {
|
||||
it.isAbsolute && !isPathAbsolute -> absolutePath.startsWith(it)
|
||||
!it.isAbsolute && isPathAbsolute -> path.startsWith(it.toAbsolutePath())
|
||||
it.isAbsolute && !isPathAbsolute -> realPath.startsWith(it)
|
||||
!it.isAbsolute && isPathAbsolute -> path.startsWith(it.toRealPath())
|
||||
else -> path.startsWith(it)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user