From 86ab38408c069a3d022897826bcf6727ac0bbf67 Mon Sep 17 00:00:00 2001 From: Nick Burtner Date: Tue, 1 Nov 2022 17:50:21 -0400 Subject: [PATCH] Fixes issue where non-archive msu-1 files would have improper file extensions --- gtk/src/gtk_file.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gtk/src/gtk_file.cpp b/gtk/src/gtk_file.cpp index 6081c4fb..da59b1f6 100644 --- a/gtk/src/gtk_file.cpp +++ b/gtk/src/gtk_file.cpp @@ -121,8 +121,15 @@ const char *S9xGetFilename(const char *ex, enum s9x_getdirtype dirtype) static std::string filename; fs::path path(S9xGetDirectory(dirtype)); path /= fs::path(Memory.ROMFilename).filename(); - path.replace_extension(ex); - filename = path.string(); + //Fixes issue with MSU-1 on linux + if(ex[0] == '-') { + path.replace_extension(""); + filename = path.string(); + filename.append(ex); + } else { + path.replace_extension(ex); + filename = path.string(); + } return filename.c_str(); }