You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2014/04/02 14:09:54 UTC

svn commit: r1583988 - /openoffice/trunk/main/vcl/aqua/source/app/salinst.cxx

Author: hdu
Date: Wed Apr  2 12:09:54 2014
New Revision: 1583988

URL: http://svn.apache.org/r1583988
Log:
#i124509# use setenv() instead of putenv() on OSX

putenv() has changed its semantic to no longer copy input buffers which
results in problems if the input buffers were only temporary. Using
setenv(), which still copies the input buffers solves the problem.

Modified:
    openoffice/trunk/main/vcl/aqua/source/app/salinst.cxx

Modified: openoffice/trunk/main/vcl/aqua/source/app/salinst.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/aqua/source/app/salinst.cxx?rev=1583988&r1=1583987&r2=1583988&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/aqua/source/app/salinst.cxx (original)
+++ openoffice/trunk/main/vcl/aqua/source/app/salinst.cxx Wed Apr  2 12:09:54 2014
@@ -303,32 +303,29 @@ void InitSalMain()
             // Assign to PATH environment variable
             if ( aCmdPath.Len() )
             {
-                aTmpPath = ByteString( "PATH=" );
-                aTmpPath += aCmdPath;
+                aTmpPath = aCmdPath;
                 if ( aPath.Len() )
                     aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
                 aTmpPath += aPath;
-                putenv( (char*)aTmpPath.GetBuffer() );
+                setenv( "PATH", aTmpPath.GetBuffer(), TRUE );
             }
             // Assign to STAR_RESOURCEPATH environment variable
             if ( aCmdPath.Len() )
             {
-                aTmpPath = ByteString( "STAR_RESOURCEPATH=" );
-                aTmpPath += aCmdPath;
+                aTmpPath = aCmdPath;
                 if ( aResPath.Len() )
                     aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
                 aTmpPath += aResPath;
-                putenv( (char*)aTmpPath.GetBuffer() );
+                setenv( "STAR_RESOURCEPATH", aTmpPath.GetBuffer(), TRUE );
             }
             // Assign to DYLD_LIBRARY_PATH environment variable
             if ( aCmdPath.Len() )
             {
-                aTmpPath = ByteString( "DYLD_LIBRARY_PATH=" );
-                aTmpPath += aCmdPath;
+                aTmpPath = aCmdPath;
                 if ( aLibPath.Len() )
                     aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
                 aTmpPath += aLibPath;
-                putenv( (char*)aTmpPath.GetBuffer() );
+                setenv( "DYLD_LIBRARY_PATH", aTmpPath.GetBuffer(), TRUE );
             }
         }
     }