mirror of
https://github.com/holub/mame
synced 2025-07-06 10:29:38 +03:00
corefile.cpp: Make core_filename_extract_base behave more robustly in degenerate cases
This commit is contained in:
parent
05da482144
commit
ad3fa37944
@ -1260,6 +1260,8 @@ std::string_view core_filename_extract_base(std::string_view name, bool strip_ex
|
||||
{
|
||||
// find the start of the basename
|
||||
auto const start = std::find_if(name.rbegin(), name.rend(), &util::is_directory_separator);
|
||||
if (start == name.rbegin())
|
||||
return std::string_view();
|
||||
|
||||
// find the end of the basename
|
||||
auto const chop_position = strip_extension
|
||||
|
Loading…
Reference in New Issue
Block a user