fix path not being found correctly when started from smpackage
This commit is contained in:
@@ -69,7 +69,17 @@ static CString GetDirOfExecutable( CString argv0 )
|
|||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
return "D:\\";
|
return "D:\\";
|
||||||
#else
|
#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( "\\", "/" );
|
sPath.Replace( "\\", "/" );
|
||||||
|
|
||||||
bool IsAbsolutePath = false;
|
bool IsAbsolutePath = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user