From d6db1f7e9680fe8d5465200d61492d235edeff30 Mon Sep 17 00:00:00 2001 From: mtabachenko Date: Sat, 23 Nov 2013 14:34:27 +0000 Subject: [PATCH] - fix path to firmware settings file (fix [#1354]); --- desmume/src/firmware.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/desmume/src/firmware.cpp b/desmume/src/firmware.cpp index d096e9fef..3493ddfba 100644 --- a/desmume/src/firmware.cpp +++ b/desmume/src/firmware.cpp @@ -601,8 +601,11 @@ std::string CFIRMWARE::GetExternalFilePath() { std::string fwPath = CommonSettings.Firmware; std::string fwFileName = Path::GetFileNameFromPathWithoutExt(fwPath); - std::string configPath = path.pathToBattery; - std::string finalPath = configPath + DIRECTORY_DELIMITER_CHAR + fwFileName + FILE_EXT_DELIMITER_CHAR + FW_CONFIG_FILE_EXT; + char configPath[MAX_PATH] = {0}; + path.getpath(path.BATTERY, configPath); + if (configPath[strlen(configPath)-1] == DIRECTORY_DELIMITER_CHAR) + configPath[strlen(configPath)-1] = 0; + std::string finalPath = std::string(configPath) + DIRECTORY_DELIMITER_CHAR + fwFileName + FILE_EXT_DELIMITER_CHAR + FW_CONFIG_FILE_EXT; return finalPath; }