From ecd600e76f06e631c15748d41b46b4702f253b50 Mon Sep 17 00:00:00 2001 From: Lukas Sabota Date: Thu, 29 Oct 2020 16:54:14 -0400 Subject: [PATCH] append .sav suffix to backups if not already present --- desmume/src/frontend/posix/gtk/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desmume/src/frontend/posix/gtk/main.cpp b/desmume/src/frontend/posix/gtk/main.cpp index 8d0e06afc..9b40e962d 100644 --- a/desmume/src/frontend/posix/gtk/main.cpp +++ b/desmume/src/frontend/posix/gtk/main.cpp @@ -1882,6 +1882,11 @@ static void ExportBackupMemoryDialog(GSimpleAction *action, GVariant *parameter, GFile *file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(pFileSelection)); gchar *sPath = g_file_get_path(file); + if(! g_str_has_suffix(sPath, ".sav")) + { + sPath = g_strjoin(NULL, sPath, ".sav", NULL); + } + if(MMU_new.backupDevice.exportData(sPath) == false ) { GtkWidget *pDialog = gtk_message_dialog_new(GTK_WINDOW(pWindow), GTK_DIALOG_MODAL,