diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 082fa9a178..47eeeb5fdd 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -69,7 +69,17 @@ static CString GetDirOfExecutable( CString argv0 ) #ifdef _XBOX return "D:\\"; #else - CString sPath = argv0; + /* argv[0] can be wrong in most OS's; try to avoid using it. */ + + CString sPath; +#if defined(_WIN32) + char buf[MAX_PATH]; + GetModuleFileName( NULL, buf, sizeof(buf) ); + sPath = buf; +#else + sPath = argv0; +#endif + sPath.Replace( "\\", "/" ); bool IsAbsolutePath = false;