summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2010-08-03 10:25:58 +0100
committerCaolán McNamara <cmc@openoffice.org>2010-08-03 10:25:58 +0100
commit3833427a35230616627fe633d34edcd314581e6a (patch)
tree530222e2d51a940322dc4bab65444e555bfe667b /tools
parent6b16723121bffd8ebf9b8e688af5457235f687ef (diff)
parentdeee1f03fb16af83c642121a5682af3398d90ece (diff)
cmcfixes77: merge with DEV300 m86
Diffstat (limited to 'tools')
-rw-r--r--tools/source/misc/extendapplicationenvironment.cxx19
-rw-r--r--tools/source/string/strucvt.cxx2
2 files changed, 6 insertions, 15 deletions
diff --git a/tools/source/misc/extendapplicationenvironment.cxx b/tools/source/misc/extendapplicationenvironment.cxx
index fe76e5329cbb..440f5a5cb207 100644
--- a/tools/source/misc/extendapplicationenvironment.cxx
+++ b/tools/source/misc/extendapplicationenvironment.cxx
@@ -29,8 +29,6 @@
#include "sal/config.h"
#include <stdlib.h>
- // not <cstdlib> as putenv is POSIX-only; setenv instead of putenv would be
- // better but is not supported by Solaris 9 and earlier
#if defined UNX
#include <sys/resource.h>
@@ -63,10 +61,9 @@ void extendApplicationEnvironment() {
// Make sure URE_BOOTSTRAP environment variable is set (failure is fatal):
rtl::OUStringBuffer env;
- env.appendAscii(RTL_CONSTASCII_STRINGPARAM("URE_BOOTSTRAP="));
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP"));
rtl::OUString uri;
- if (rtl::Bootstrap::get(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP")), uri))
+ if (rtl::Bootstrap::get(envVar, uri))
{
if (!uri.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.pathname:")))
@@ -86,16 +83,8 @@ void extendApplicationEnvironment() {
env.appendAscii(
RTL_CONSTASCII_STRINGPARAM(SAL_CONFIGFILE("fundamental")));
}
- rtl::OString s;
- if (!env.makeStringAndClear().convertToString(
- &s, osl_getThreadTextEncoding(),
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
- | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
- {
- abort();
- }
- rtl_string_acquire(s.pData); // argument to putenv must leak
- if (putenv(const_cast< char * >(s.getStr())) != 0) {
+ rtl::OUString envValue(env.makeStringAndClear());
+ if (osl_setEnvironment(envVar.pData, envValue.pData) != osl_Process_E_None) {
abort();
}
}
diff --git a/tools/source/string/strucvt.cxx b/tools/source/string/strucvt.cxx
index 7198d0e8f98c..9c9ef1dc4b5a 100644
--- a/tools/source/string/strucvt.cxx
+++ b/tools/source/string/strucvt.cxx
@@ -201,6 +201,8 @@ UniString::UniString( const ResId& rResId )
Append( UniString::CreateFromInt32( rResId.GetId() ) );
AppendAscii( " not found>" );
#endif
+ if( pResMgr )
+ pResMgr->PopContext();
}