Kaydet (Commit) 7a163014 authored tarafından Herbert Dürr's avatar Herbert Dürr

#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.
üst d3c4a0c2
...@@ -303,32 +303,29 @@ void InitSalMain() ...@@ -303,32 +303,29 @@ void InitSalMain()
// Assign to PATH environment variable // Assign to PATH environment variable
if ( aCmdPath.Len() ) if ( aCmdPath.Len() )
{ {
aTmpPath = ByteString( "PATH=" ); aTmpPath = aCmdPath;
aTmpPath += aCmdPath;
if ( aPath.Len() ) if ( aPath.Len() )
aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aPath; aTmpPath += aPath;
putenv( (char*)aTmpPath.GetBuffer() ); setenv( "PATH", aTmpPath.GetBuffer(), TRUE );
} }
// Assign to STAR_RESOURCEPATH environment variable // Assign to STAR_RESOURCEPATH environment variable
if ( aCmdPath.Len() ) if ( aCmdPath.Len() )
{ {
aTmpPath = ByteString( "STAR_RESOURCEPATH=" ); aTmpPath = aCmdPath;
aTmpPath += aCmdPath;
if ( aResPath.Len() ) if ( aResPath.Len() )
aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aResPath; aTmpPath += aResPath;
putenv( (char*)aTmpPath.GetBuffer() ); setenv( "STAR_RESOURCEPATH", aTmpPath.GetBuffer(), TRUE );
} }
// Assign to DYLD_LIBRARY_PATH environment variable // Assign to DYLD_LIBRARY_PATH environment variable
if ( aCmdPath.Len() ) if ( aCmdPath.Len() )
{ {
aTmpPath = ByteString( "DYLD_LIBRARY_PATH=" ); aTmpPath = aCmdPath;
aTmpPath += aCmdPath;
if ( aLibPath.Len() ) if ( aLibPath.Len() )
aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ); aTmpPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
aTmpPath += aLibPath; aTmpPath += aLibPath;
putenv( (char*)aTmpPath.GetBuffer() ); setenv( "DYLD_LIBRARY_PATH", aTmpPath.GetBuffer(), TRUE );
} }
} }
} }
......
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