From ae8b910bb9f26e274dece97510c608d0dcb9c152 Mon Sep 17 00:00:00 2001 From: codereader Date: Sun, 20 Sep 2020 09:49:29 +0200 Subject: [PATCH] #5289: Fix particle files getting generated with two dots in their filenames (..prt) --- libs/wxutil/FileChooser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/wxutil/FileChooser.cpp b/libs/wxutil/FileChooser.cpp index 8b0c6ee91b..0acd0cfd91 100644 --- a/libs/wxutil/FileChooser.cpp +++ b/libs/wxutil/FileChooser.cpp @@ -12,6 +12,7 @@ #include "dialog/MessageBox.h" #include "string/predicate.h" #include "string/case_conv.h" +#include "string/trim.h" #include namespace wxutil @@ -63,8 +64,9 @@ void FileChooser::construct() _title = _open ? _("Open File") : _("Save File"); } - // Make default extension lowercase + // Make default extension lowercase, and cut off any dots at the beginning string::to_lower(_defaultExt); + string::trim_left(_defaultExt, "."); if (!_open && _fileType == filetype::TYPE_MAP_EXPORT) {