summaryrefslogtreecommitdiff
path: root/cpputools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-10-18 15:45:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2010-10-18 15:45:17 +0100
commitc3b0a4073d2e4917c5a010548ae2a1eb5ebbf9a5 (patch)
tree76a19cfb10c5d1c0070cac7fa8a41cac92c2d33d /cpputools
parentf7dc4d73859ba109a54d01f137241d7848a587cf (diff)
#i112656# add osl_setEnvironment and osl_clearEnvironment
Diffstat (limited to 'cpputools')
-rw-r--r--cpputools/source/registercomponent/registercomponent.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx
index e2394b6ab..4f3c498d3 100644
--- a/cpputools/source/registercomponent/registercomponent.cxx
+++ b/cpputools/source/registercomponent/registercomponent.cxx
@@ -67,10 +67,6 @@ using com::sun::star::container::XSet;
using com::sun::star::container::XContentEnumerationAccess;
using com::sun::star::container::XEnumeration;
-#ifdef SAL_W32
-#define putenv _putenv
-#endif
-
namespace {
OUString replacePrefix(OUString const & url, OUString const & prefix) {
@@ -314,14 +310,9 @@ sal_Bool parseOptions(int ac, char* av[], Options& rOptions, sal_Bool bCmdFile)
i++;
if( i < ac )
{
- // leak this string as some platforms assume to own
- // the pointer
- sal_Char * p = (sal_Char *) rtl_allocateMemory( 13+ strlen( av[i] ) );
- p[0] = 0;
- strcat( p, "CLASSPATH=" ); // #100211# - checked
- strcat( p, av[i] ); // #100211# - checked
-
- putenv( p );
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("CLASSPATH"));
+ rtl::OUString envValue(av[i], strlen(av[i]), osl_getThreadTextEncoding());
+ osl_setEnvironment(envVar.pData, envValue.pData);
}
break;
}