diff options
author | 2020-05-30 13:07:31 -0400 | |
---|---|---|
committer | 2020-05-30 13:07:31 -0400 | |
commit | dfd0305ca35d3ac4dea29eb02aaf1d0642bc0305 (patch) | |
tree | 6450f622602927140843fa41dc1c86d548eee8ef | |
parent | 4b4cfed14dae9afe08ef178992fd6703a176932d (diff) |
Have the -romident command skip the matching process and issue an error message when no files are found
-rw-r--r-- | src/frontend/mame/clifront.cpp | 4 | ||||
-rw-r--r-- | src/frontend/mame/media_ident.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index aa5ec7606b8..7d21585e3c7 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -1452,7 +1452,9 @@ void cli_frontend::romident(const std::vector<std::string> &args) ident.identify(filename); // return the appropriate error code - if (ident.matches() == ident.total()) + if (ident.total() == 0) + throw emu_fatalerror(EMU_ERR_MISSING_FILES, "No files found.\n"); + else if (ident.matches() == ident.total()) return; else if (ident.matches() == ident.total() - ident.nonroms()) throw emu_fatalerror(EMU_ERR_IDENT_NONROMS, "Out of %d files, %d matched, %d are not roms.\n", ident.total(), ident.matches(), ident.nonroms()); diff --git a/src/frontend/mame/media_ident.cpp b/src/frontend/mame/media_ident.cpp index 9881e992a51..44b4271a7e5 100644 --- a/src/frontend/mame/media_ident.cpp +++ b/src/frontend/mame/media_ident.cpp @@ -332,6 +332,9 @@ void media_identifier::digest_data(std::vector<file_info> &info, char const *nam void media_identifier::match_hashes(std::vector<file_info> &info) { + if (info.empty()) + return; + auto match_device = [&info, listnames = std::unordered_set<std::string>()] (device_t &device) mutable { |