Skip to content

Commit

Permalink
Land #719, Fix a regression in the search behavior
Browse files Browse the repository at this point in the history
Land #719, Fix a regression in the search behavior
  • Loading branch information
dledda-r7 authored Oct 10, 2024
2 parents 924f586 + ff617cf commit c372a98
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,16 @@ private static boolean matches(String text, String glob) {

public static List findFiles(String path, String mask, boolean recurse, Integer startDate, Integer endDate) {
try {
File pathfile = Loader.expand(path);
if (!pathfile.exists() || !pathfile.isDirectory()) {
pathfile = new File(path);
if (!pathfile.exists() || !pathfile.isDirectory()) {
File pathFile = Loader.expand(path);
if (!pathFile.exists() || !pathFile.isDirectory()) {
pathFile = new File(path);
if (!pathFile.exists() || !pathFile.isDirectory()) {
throw new IOException("Path not found: " + path);
}
}
path = pathfile.getCanonicalPath();
String[] lst = new File(path).list();
path = pathFile.getCanonicalPath();
pathFile = new File(path);
String[] lst = pathFile.list();
List glob = new ArrayList();
if (lst == null) {
return glob;
Expand All @@ -81,7 +82,7 @@ public static List findFiles(String path, String mask, boolean recurse, Integer
if (lst[i] == null) {
continue;
}
File file = new File(lst[i]);
File file = new File(pathFile, lst[i]);
if (recurse && file.isDirectory()
// don't follow links to avoid infinite recursion
&& file.getCanonicalPath().equals(file.getAbsolutePath())) {
Expand Down

0 comments on commit c372a98

Please sign in to comment.