Commit 54ad108a authored by AnimeGitB's avatar AnimeGitB
Browse files

Fix edge case on FileUtils::getFilenameWithoutPath

parent ccf182d6
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment