correct reading the working directory string
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3761 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f6f6b870a9
commit
f324d4b27d
|
@ -164,15 +164,19 @@ bool DolphinApp::OnInit()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char tmpChar[256];
|
char *tmpChar;
|
||||||
fread(tmpChar, 1, 255, workingDir);
|
long len;
|
||||||
|
fseek(workingDir,0,SEEK_END);
|
||||||
|
len=ftell(workingDir);
|
||||||
|
fseek(workingDir,0,SEEK_SET);
|
||||||
|
tmpChar = new char[len];
|
||||||
|
fread(tmpChar, len, 1, workingDir);
|
||||||
fclose(workingDir);
|
fclose(workingDir);
|
||||||
wxSetWorkingDirectory(wxString::FromAscii(tmpChar));
|
if (!wxSetWorkingDirectory(wxString::FromAscii(tmpChar)))
|
||||||
//PanicAlert("%s\n%s",tmpChar, (const char*)wxGetCwd().mb_str(/*wxConvUTF8*/));
|
|
||||||
if (strcmp(tmpChar, wxGetCwd().mb_str()) != 0)
|
|
||||||
{
|
{
|
||||||
PanicAlert("set working directory failed");
|
PanicAlert("set working directory failed");
|
||||||
}
|
}
|
||||||
|
delete [] tmpChar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue