[ 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:
@@ -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() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user