diff --git a/gtk/src/gtk_file.cpp b/gtk/src/gtk_file.cpp index d5ea8e76..5d2aafd2 100644 --- a/gtk/src/gtk_file.cpp +++ b/gtk/src/gtk_file.cpp @@ -178,38 +178,8 @@ static int file_exists(const char *name) } } -bool8 S9xOpenSnapshotFile(const char *fname, bool8 read_only, STREAM *file) +bool8 S9xOpenSnapshotFile(const char *filename, bool8 read_only, STREAM *file) { - char filename[PATH_MAX + 1]; - char drive[_MAX_DRIVE + 1]; - char dir[_MAX_DIR + 1]; - char ext[_MAX_EXT + 1]; - - _splitpath(fname, drive, dir, filename, ext); - - if (*drive || *dir == '/' || (*dir == '.' && (*(dir + 1) == '/'))) - { - snprintf(filename, PATH_MAX + 1, "%s", fname); - - if (!file_exists(filename)) - { - if (!*ext) - strcat(filename, ".s9x"); - } - } - else - { - strcpy(filename, S9xGetDirectory(SNAPSHOT_DIR)); - strcat(filename, SLASH_STR); - strcat(filename, fname); - - if (!file_exists(filename)) - { - if (!*ext) - strcat(filename, ".s9x"); - } - } - #ifdef ZLIB if (read_only) { diff --git a/gtk/src/gtk_s9xwindow.cpp b/gtk/src/gtk_s9xwindow.cpp index 3564aae1..983c55f4 100644 --- a/gtk/src/gtk_s9xwindow.cpp +++ b/gtk/src/gtk_s9xwindow.cpp @@ -838,7 +838,7 @@ void Snes9xWindow::save_state_dialog() dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); dialog.add_button(Gtk::StockID("gtk-save"), Gtk::RESPONSE_ACCEPT); dialog.set_current_folder(S9xGetDirectory(SNAPSHOT_DIR)); - dialog.set_current_name(S9xGetFilename(".sst", SNAPSHOT_DIR)); + dialog.set_current_name(S9xBasename(S9xGetFilename(".sst", SNAPSHOT_DIR))); dialog.add_filter(get_save_states_file_filter()); dialog.add_filter(get_all_files_filter());