1.25.0.2 Fixed: F12 Snapshot_LoadState() -> Snapshot_SetFilename() not keeping trailing backslash on path

This commit is contained in:
michaelangel007 2014-09-02 08:48:46 -07:00
parent 1083f0e981
commit 807fcce1ef
2 changed files with 11 additions and 1 deletions

View File

@ -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);
}

View File

@ -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;