summaryrefslogtreecommitdiff
path: root/vcl/aqua
diff options
context:
space:
mode:
authorPatrick Luby <pluby@openoffice.org>2001-03-05 01:01:42 +0000
committerPatrick Luby <pluby@openoffice.org>2001-03-05 01:01:42 +0000
commitd68448d79d2a8aa6a0986f3f8437546ef282a19d (patch)
tree7ec22ab508ee4c17a3f4aa838e9c139bad706953 /vcl/aqua
parentb28c779cb79f17fb4b4cfc7ca3090514fd39062f (diff)
Corrections to InitSalMain
Diffstat (limited to 'vcl/aqua')
-rw-r--r--vcl/aqua/source/app/salinst.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index b5068697cb98..18dd15c5e9d9 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salinst.cxx,v $
*
- * $Revision: 1.28 $
+ * $Revision: 1.29 $
*
- * last change: $Author: pluby $ $Date: 2001-02-28 03:15:14 $
+ * last change: $Author: pluby $ $Date: 2001-03-05 02:01:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -130,13 +130,22 @@ void DeInitSalData()
void InitSalMain()
{
+ extern char **environ;
+ char **pEnviron;
+
+ // Get full executable path. We cna't use __progname as that only holds
+ // the name of the executable and not the path. The full executable path
+ // is listed after the first NULL in *environ.
+ pEnviron = environ;
+ while ( *pEnviron++ )
+ ;
+
// Need to include the absolute path for this executable in the PATH
// and STAR_RESOURCEPATH environment variables so that the resource manager
// can find resource files and in the DYLD_LIBRARY_PATH environment
// variable so that the dynamic library loader can find shared libraries
- extern const char *__progname;
ByteString aPath( getenv( "PATH" ) );
- ByteString aCmdPath( __progname );
+ ByteString aCmdPath( *pEnviron );
// Get absolute path of command's directory
if ( aCmdPath.Len() ) {
DirEntry aCmdDirEntry( aCmdPath );