mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-16 15:40:14 +00:00
Merge remote-tracking branch
'origin/GP-4050_ryanmkurtz_InvalidPathException--SQUASHED' into patch (Closes #5894)
This commit is contained in:
commit
041be82286
@ -17,8 +17,7 @@ package ghidra.app.util.opinion;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -1059,13 +1058,18 @@ public abstract class AbstractLibrarySupportLoader extends AbstractProgramLoader
|
||||
List<FileSystemSearchPath> result = new ArrayList<>();
|
||||
FileSystemService fsService = FileSystemService.getInstance();
|
||||
if (isLoadSystemLibraries(options) || shouldSearchAllPaths(options)) {
|
||||
List<Path> searchPaths = LibrarySearchPathManager.getLibraryPathsList()
|
||||
.stream()
|
||||
.map(s -> Path.of(s).normalize())
|
||||
.filter(Path::isAbsolute)
|
||||
.filter(Files::exists)
|
||||
.toList();
|
||||
|
||||
List<Path> searchPaths = new ArrayList<>();
|
||||
for (String str : LibrarySearchPathManager.getLibraryPathsList()) {
|
||||
try {
|
||||
Path path = Path.of(str).normalize();
|
||||
if (path.isAbsolute() && Files.exists(path)) {
|
||||
searchPaths.add(path);
|
||||
}
|
||||
}
|
||||
catch (InvalidPathException e) {
|
||||
log.appendMsg("Skipping invalid system library search path: \"" + str + "\"");
|
||||
}
|
||||
}
|
||||
for (Path searchPath : searchPaths) {
|
||||
try {
|
||||
FSRL searchFSRL = fsService.getLocalFSRL(searchPath.toFile());
|
||||
|
Loading…
Reference in New Issue
Block a user