Fix edge case on FileUtils::getFilenameWithoutPath

This commit is contained in:
AnimeGitB 2022-10-22 17:14:03 +10:30
parent ccf182d692
commit 54ad108a14

View File

@ -167,9 +167,11 @@ public final class FileUtils {
} }
} }
@Deprecated // No current uses of this anyway
public static String getFilenameWithoutPath(String fileName) { public static String getFilenameWithoutPath(String fileName) {
if (fileName.indexOf(".") > 0) { int i = fileName.lastIndexOf(".");
return fileName.substring(0, fileName.lastIndexOf(".")); if (i > 0) {
return fileName.substring(0, i);
} else { } else {
return fileName; return fileName;
} }