Fix ChangeToDirOfExecutable in Windows.

This commit is contained in:
Glenn Maynard
2003-09-05 07:15:21 +00:00
parent 198ce73873
commit 23a543d7e0
+9 -1
View File
@@ -90,7 +90,15 @@ static void ChangeToDirOfExecutable(const char *argv0)
else
DirOfExecutable.erase();
if( DirOfExecutable.size() == 0 || (DirOfExecutable[0] != '/' && DirOfExecutable[0] != '\\') )
bool IsAbsolutePath = false;
if( DirOfExecutable.size() == 0 || (DirOfExecutable[0] == '/' || DirOfExecutable[0] == '\\') )
IsAbsolutePath = true;
#if defined(_WIN32)
if( DirOfExecutable.size() > 2 && DirOfExecutable[1] == ':' ) /* XXX: "c:foo" is relative */
IsAbsolutePath = true;
#endif
if( !IsAbsolutePath )
DirOfExecutable = GetCwd() + "/" + DirOfExecutable;
#ifndef _XBOX