Kaydet (Commit) f0fde4a0 authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS crashrep8 (1.20.16); FILE MERGED

2005/05/04 10:22:21 hro 1.20.16.1: #121982# Resolve softlinks in paths sent by crash reporting mechanism
üst cd401a03
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: main.cxx,v $ * $RCSfile: main.cxx,v $
* *
* $Revision: 1.20 $ * $Revision: 1.21 $
* *
* last change: $Author: hr $ $Date: 2004-12-20 09:35:15 $ * last change: $Author: obo $ $Date: 2005-05-06 09:17:53 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -600,13 +600,21 @@ string crash_get_details( const hash_map< string, string >& rSettings ) ...@@ -600,13 +600,21 @@ string crash_get_details( const hash_map< string, string >& rSettings )
// ensure validity of program relative paths // ensure validity of program relative paths
static void setup_program_dir( const char* progname ) static void setup_program_dir( const char* progname )
{ {
string aDir = progname; char szCanonicProgPath[PATH_MAX];
size_t pos = aDir.rfind( '/' );
// FIXME: search PATH if necessary
assert( pos != string::npos ); if ( realpath( progname, szCanonicProgPath ) )
g_strProgramDir = aDir.substr( 0, pos + 1 ); {
aDir.erase( pos ); string aDir = szCanonicProgPath;
chdir( aDir.c_str() );
size_t pos = aDir.rfind( '/' );
// FIXME: search PATH if necessary
assert( pos != string::npos );
g_strProgramDir = aDir.substr( 0, pos + 1 );
aDir.erase( pos );
chdir( aDir.c_str() );
}
} }
//************************************************************************* //*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment