use M_BaseName() in M_FileCaseExists()

This commit is contained in:
Fabian Greffrath 2023-07-13 09:42:07 +02:00
parent dafff23764
commit ef1362f613

View File

@ -92,15 +92,8 @@ char *M_FileCaseExists(const char *path)
return path_dup;
}
filename = strrchr(path_dup, DIR_SEPARATOR);
if (filename != NULL)
{
filename++;
}
else
{
filename = path_dup;
}
// cast result to (char *), because `path_dup` isn't (const char *) in the first place
filename = (char *) M_BaseName(path_dup);
// 1: lowercase filename, e.g. doom2.wad
M_ForceLowercase(filename);