Fix: SetCurrentImageDir() to always make sure g_sCurrentDir has trailing backslash

This commit is contained in:
michaelangel007 2014-09-03 17:14:06 -07:00
parent 807fcce1ef
commit ce2f0b75cb

View File

@ -622,14 +622,12 @@ void SetCurrentImageDir(const char* pszImageDir)
{ {
strcpy(g_sCurrentDir, pszImageDir); strcpy(g_sCurrentDir, pszImageDir);
#if _DEBUG
int nLen = strlen( g_sCurrentDir ); int nLen = strlen( g_sCurrentDir );
if( g_sCurrentDir[ nLen - 1 ] != '\\' ) if( g_sCurrentDir[ nLen - 1 ] != '\\' )
{ {
g_sCurrentDir[ nLen - 1 ] = '\\'; g_sCurrentDir[ nLen + 0 ] = '\\';
g_sCurrentDir[ nLen ] = 0; g_sCurrentDir[ nLen + 1 ] = 0;
} }
#endif
SetCurrentDirectory(g_sCurrentDir); SetCurrentDirectory(g_sCurrentDir);
} }