diff options
Diffstat (limited to 'src/emu/ui/filesel.cpp')
-rw-r--r-- | src/emu/ui/filesel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/emu/ui/filesel.cpp b/src/emu/ui/filesel.cpp index 7a8cd32ec94..58b3d338ffe 100644 --- a/src/emu/ui/filesel.cpp +++ b/src/emu/ui/filesel.cpp @@ -19,6 +19,8 @@ #include "ui/filesel.h" #include "imagedev/floppy.h" +#include <cstring> + /*************************************************************************** CONSTANTS @@ -224,6 +226,8 @@ ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_contai m_image = image; m_ok = ok; *m_ok = true; + auto const sep = current_file.rfind(PATH_SEPARATOR); + std::strncpy(m_filename_buffer, current_file.c_str() + ((std::string::npos == sep) ? 0 : (sep + 1)), sizeof(m_filename_buffer)); } @@ -307,7 +311,7 @@ void ui_menu_file_create::handle() std::string tmp_file(m_filename_buffer); if (tmp_file.find(".") != -1 && tmp_file.find(".") < tmp_file.length() - 1) { - m_current_file.append(m_filename_buffer); + m_current_file = m_filename_buffer; ui_menu::stack_pop(machine()); } else |