mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 03:33:20 +08:00
Fix edge case on FileUtils::getFilenameWithoutPath
This commit is contained in:
parent
ccf182d692
commit
54ad108a14
@ -167,9 +167,11 @@ public final class FileUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated // No current uses of this anyway
|
||||
public static String getFilenameWithoutPath(String fileName) {
|
||||
if (fileName.indexOf(".") > 0) {
|
||||
return fileName.substring(0, fileName.lastIndexOf("."));
|
||||
int i = fileName.lastIndexOf(".");
|
||||
if (i > 0) {
|
||||
return fileName.substring(0, i);
|
||||
} else {
|
||||
return fileName;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user