From 807fcce1efe0176811f076c9cc6efa3b06fc8e02 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Tue, 2 Sep 2014 08:48:46 -0700 Subject: [PATCH] 1.25.0.2 Fixed: F12 Snapshot_LoadState() -> Snapshot_SetFilename() not keeping trailing backslash on path --- source/Applewin.cpp | 10 ++++++++++ source/SaveState.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/Applewin.cpp b/source/Applewin.cpp index 47384c24..27544837 100644 --- a/source/Applewin.cpp +++ b/source/Applewin.cpp @@ -621,6 +621,16 @@ void LoadConfiguration(void) void SetCurrentImageDir(const char* pszImageDir) { strcpy(g_sCurrentDir, pszImageDir); + +#if _DEBUG + int nLen = strlen( g_sCurrentDir ); + if( g_sCurrentDir[ nLen - 1 ] != '\\' ) + { + g_sCurrentDir[ nLen - 1 ] = '\\'; + g_sCurrentDir[ nLen ] = 0; + } +#endif + SetCurrentDirectory(g_sCurrentDir); } diff --git a/source/SaveState.cpp b/source/SaveState.cpp index b5566ba5..5c38beed 100644 --- a/source/SaveState.cpp +++ b/source/SaveState.cpp @@ -74,7 +74,7 @@ void Snapshot_SetFilename(std::string strPathname) if (nIdx >= 0 && nIdx+1 < (int)strPathname.length()) { strFilename = &strPathname[nIdx+1]; - g_strSaveStatePath = strPathname.substr(0, nIdx); + g_strSaveStatePath = strPathname.substr(0, nIdx+1); // Bugfix: 1.25.0.2 // Snapshot_LoadState() -> SetCurrentImageDir() -> g_sCurrentDir } g_strSaveStateFilename = strFilename;