From c3b0a4073d2e4917c5a010548ae2a1eb5ebbf9a5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Oct 2010 15:45:17 +0100 Subject: #i112656# add osl_setEnvironment and osl_clearEnvironment --- cpputools/source/registercomponent/registercomponent.cxx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'cpputools/source') 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; } -- cgit v1.2.3