diff options
author | Nathan Woods <npwoods@mess.org> | 2017-07-23 11:48:19 -0400 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2017-07-24 01:56:49 +1000 |
commit | f8e83ddf3ac1bbe33633e7dfc9121ffa173834cd (patch) | |
tree | 719541fba0a0eafb095195c3cb5c127b5d1ada38 | |
parent | 51e574a3511e23b2d350a29ff08234e04c0aaa4b (diff) |
Cleanup/bulletproofing to the issue Wizz just found
-rw-r--r-- | src/emu/image.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/emu/image.cpp b/src/emu/image.cpp index f98ecd65f31..06ae645fb39 100644 --- a/src/emu/image.cpp +++ b/src/emu/image.cpp @@ -200,15 +200,12 @@ void image_manager::options_extract() std::string image_opt; if (image.exists()) { - if (image.loaded_through_softlist()) - { - image_opt = util::string_format("%s:%s", image.software_list_name(), image.full_software_name()); - const software_part *tmp = image.part_entry(); - if (!tmp->name().empty()) - image_opt.append(":").append(tmp->name()); - } - else + if (!image.loaded_through_softlist()) image_opt = image.filename(); + else if (image.part_entry() && !image.part_entry()->name().empty()) + image_opt = util::string_format("%s:%s:%s", image.software_list_name(), image.full_software_name(), image.part_entry()->name()); + else + image_opt = util::string_format("%s:%s", image.software_list_name(), image.full_software_name()); } // and set the option (provided that it hasn't been removed out from under us) |