mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 09:48:51 +01:00
Fix crash when launcher files don't have extensions.
This commit is contained in:
parent
2f9c8c301f
commit
aacb41102f
@ -156,9 +156,16 @@ bool ImportConfiguration(Configuration *c)
|
|||||||
if (dirp->d_type != DT_DIR && std::string(dirp->d_name) != "." && std::string(dirp->d_name) != "..")
|
if (dirp->d_type != DT_DIR && std::string(dirp->d_name) != "." && std::string(dirp->d_name) != "..")
|
||||||
{
|
{
|
||||||
std::string basename = dirp->d_name;
|
std::string basename = dirp->d_name;
|
||||||
|
std::string::size_type dot_position = basename.find_last_of(".");
|
||||||
|
|
||||||
std::string extension = basename.substr(basename.find_last_of("."), basename.size()-1);
|
if (dot_position == std::string::npos)
|
||||||
basename = basename.substr(0, basename.find_last_of("."));
|
{
|
||||||
|
Logger::write(Logger::ZONE_NOTICE, "RetroFE", "Extension missing on launcher file \"" + basename + "\"");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string extension = basename.substr(dot_position, basename.size()-1);
|
||||||
|
basename = basename.substr(0, dot_position);
|
||||||
|
|
||||||
if(extension == ".conf")
|
if(extension == ".conf")
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user