summaryrefslogtreecommitdiff
path: root/cpputools
diff options
context:
space:
mode:
authorCaol?n McNamara <cmc@openoffice.org>2010-06-24 20:59:17 +0100
committerCaol?n McNamara <cmc@openoffice.org>2010-06-24 20:59:17 +0100
commit7add7926efaaeee7dd7913fd6df2b07a293c24f4 (patch)
tree25b24e3b1264a66860d375dabf73aea772cdaf18 /cpputools
parent5394e06d449e0c1326edd899553f9ab3d67b7078 (diff)
cmcfixes76: #i112656# osl_setEnvironment/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 70e469ddba23..c487d95c59a5 100644
--- a/cpputools/source/registercomponent/registercomponent.cxx
+++ b/cpputools/source/registercomponent/registercomponent.cxx
@@ -66,10 +66,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) {
@@ -313,14 +309,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;
}