diff --git a/CHANGELOG.md b/CHANGELOG.md index 32ecca235..75e653530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. - [#1951] Clearing Namespace/Multiname cache after renaming identifiers - [#1951] Renaming invalid identifiers with existing string collisions - [#1888] String casts - ConvertS on XML, XMLList +- [#1953] Save as EXE - add file extension when missing ## [18.3.3] - 2023-01-22 ### Added @@ -2920,8 +2921,9 @@ All notable changes to this project will be documented in this file. [#1948]: https://www.free-decompiler.com/flash/issues/1948 [#1941]: https://www.free-decompiler.com/flash/issues/1941 [#1951]: https://www.free-decompiler.com/flash/issues/1951 -[#1913]: https://www.free-decompiler.com/flash/issues/1913 [#1888]: https://www.free-decompiler.com/flash/issues/1888 +[#1953]: https://www.free-decompiler.com/flash/issues/1953 +[#1913]: https://www.free-decompiler.com/flash/issues/1913 [#1894]: https://www.free-decompiler.com/flash/issues/1894 [#1801]: https://www.free-decompiler.com/flash/issues/1801 [#1892]: https://www.free-decompiler.com/flash/issues/1892 diff --git a/src/com/jpexs/decompiler/flash/gui/Main.java b/src/com/jpexs/decompiler/flash/gui/Main.java index 510af016c..98290216b 100644 --- a/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/src/com/jpexs/decompiler/flash/gui/Main.java @@ -1899,6 +1899,7 @@ public class Main { }; ExeExportMode exeExportMode = null; + FileFilter exeFilter = null; if (mode == SaveFileMode.EXE) { exeExportMode = Configuration.exeExportMode.get(); if (exeExportMode == null) { @@ -1925,7 +1926,7 @@ public class Main { String fext = ext; String ffilterDescription = filterDescription; - FileFilter exeFilter = new FileFilter() { + exeFilter = new FileFilter() { @Override public boolean accept(File f) { return (f.getName().toLowerCase(Locale.ENGLISH).endsWith(fext)) || (f.isDirectory()); @@ -1971,6 +1972,11 @@ public class Main { fileName += ".abc"; } } + if (selFilter == exeFilter) { + if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(extension)) { + fileName += extension; + } + } Main.saveFile(openable, fileName, mode, exeExportMode); Configuration.lastSaveDir.set(file.getParentFile().getAbsolutePath()); return true;