[jOOQ/jOOQ#9726] FilePattern matches too many files when wildcards are being used

This commit is contained in:
Lukas Eder 2020-01-14 15:47:49 +01:00
parent cff813a73e
commit 4809fd4a55

View File

@ -228,12 +228,7 @@ public final class FilePattern {
}
else {
String prefix = pattern.replaceAll("[*?].*", "");
File canonical = new File(prefix).getCanonicalFile();
if (canonical.exists())
file = canonical;
else
file = basedir.getCanonicalFile();
file = new File(basedir, prefix).getCanonicalFile();
Pattern regex = Pattern.compile("^.*?"
+ pattern