diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-18 15:45:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-18 15:45:17 +0100 |
commit | c2288bd3cb1343d881634e674bf31f41430567cf (patch) | |
tree | f7c9320a7c587c3c86ddb01d1319f24ce6442a04 /cpputools | |
parent | fcc44a688d0f2b9855a7fa82cb8b48f165ba75ab (diff) |
#i112656# add osl_setEnvironment and osl_clearEnvironment
Diffstat (limited to 'cpputools')
-rw-r--r-- | cpputools/source/registercomponent/registercomponent.cxx | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/cpputools/source/registercomponent/registercomponent.cxx b/cpputools/source/registercomponent/registercomponent.cxx index 7cab63db0b60..23f83bf8ccdf 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; } |