[ 1590221 ] wxStandardPaths::GetExecutablePath

Required for optimised stackwalker patch.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-11-12 12:58:10 +00:00
parent 6cd5337946
commit ac7ad70d4c
11 changed files with 103 additions and 6 deletions

View File

@@ -106,11 +106,9 @@ wxStandardPaths::GetLocalizedResourcesDir(const wxChar *lang,
// wxStandardPaths implementation for Unix
// ============================================================================
void wxStandardPaths::DetectPrefix()
wxString wxStandardPaths::GetExecutablePath() const
{
#ifdef __LINUX__
// under Linux, we can try to infer the prefix from the location of the
// executable
wxString exeStr;
char buf[4096];
@@ -137,6 +135,17 @@ void wxStandardPaths::DetectPrefix()
wxGetEnv(wxT(" "), &exeStr);
}
if ( !exeStr.empty() )
return exeStr;
#endif // __LINUX__
return wxStandardPathsBase::GetExecutablePath();
}
void wxStandardPaths::DetectPrefix()
{
// we can try to infer the prefix from the location of the executable
wxString exeStr = GetExecutablePath();
if ( !exeStr.empty() )
{
// consider that we're in the last "bin" subdirectory of our prefix
@@ -144,7 +153,6 @@ void wxStandardPaths::DetectPrefix()
if ( pos != wxString::npos )
m_prefix.assign(exeStr, 0, pos);
}
#endif // __LINUX__
if ( m_prefix.empty() )
{