From e34da803f6dd133e89b0a06dd65cb4bffc01b1a8 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Wed, 28 Feb 2024 21:08:42 +0100 Subject: [PATCH] Fix save state export dialog not opening --- CHANGELOG.md | 1 + Makefile | 3 ++- src/poptracker.cpp | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d71e005..6d16f6f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * Fix scrolling behavior in map tooltip when last element is hidden * Fix unnamed map tooltip section not properly updating * Fix handling of leading comma in json and Item.IconMods + * Fix save state export dialog not opening when pack name has special characters in it ## v0.25.7 diff --git a/Makefile b/Makefile index 005e512c..442515c5 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,8 @@ HDR = $(wildcard $(SRC_DIR)/*.h) \ $(wildcard $(SRC_DIR)/ap/*.h) \ $(wildcard $(SRC_DIR)/luaconnector/*.h) \ $(wildcard $(SRC_DIR)/http/*.h) \ - $(wildcard $(SRC_DIR)/packmanager/*.h) + $(wildcard $(SRC_DIR)/packmanager/*.h) \ + $(wildcard $(LIB_DIR)/tinyfiledialogs/*) INCLUDE_DIRS = -Ilib -Ilib/lua -Ilib/asio/include -DASIO_STANDALONE -Ilib/miniz -Ilib/json/include -Ilib/valijson/include -Ilib/tinyfiledialogs -Ilib/wswrap/include #-Ilib/gifdec WIN32_INCLUDE_DIRS = -Iwin32-lib/i686/include WIN32_LIB_DIRS = -L./win32-lib/i686/bin -L./win32-lib/i686/lib diff --git a/src/poptracker.cpp b/src/poptracker.cpp index dbf477bf..d60f5b7b 100644 --- a/src/poptracker.cpp +++ b/src/poptracker.cpp @@ -523,8 +523,9 @@ bool PopTracker::start() if (!_pack) return; std::string lastName; if (_exportFile.empty() || _exportUID != _pack->getUID()) { - lastName = _pack->getGameName() + ".json"; - if (!_exportDir.empty()) lastName = os_pathcat(_exportDir, lastName); + lastName = sanitize_filename(_pack->getGameName()) + ".json"; + if (!_exportDir.empty()) + lastName = os_pathcat(_exportDir, lastName); } else { lastName = _exportFile; }