diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2001-06-29 07:59:01 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2001-06-29 07:59:01 +0000 |
commit | 824d65702a9946d3952ce57af1a288eaacc2bf1e (patch) | |
tree | 0328117ddfa015f8c77092ad176eeb62a4c37c56 /cpputools | |
parent | 40e46b38752f7eeea78c239e0c66d38fc521d9a7 (diff) |
#88981# transfer proper command args to XMain
Diffstat (limited to 'cpputools')
-rw-r--r-- | cpputools/source/unoexe/unoexe.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 1b543da96069..5b86e8569f75 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoexe.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: kr $ $Date: 2001-05-28 15:31:06 $ + * last change: $Author: dbo $ $Date: 2001-06-29 08:59:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -153,7 +153,7 @@ static sal_Bool readOption( OUString * pValue, const sal_Char * pOpt, ++(*pnIndex); rtl_getAppCommandArg(*pnIndex, &pValue->pData); - if (*pnIndex >= rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash)) + if (*pnIndex >= (sal_Int32)rtl_getAppCommandArgCount() || pValue->copy(1).equals(dash)) { OUStringBuffer buf( 32 ); buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("incomplete option \"-") ); @@ -597,8 +597,9 @@ extern "C" int SAL_CALL main( int argc, const char * argv[] ) OUString aReadWriteRegistry; sal_Int32 nPos = 0; + sal_Int32 nCount = (sal_Int32)rtl_getAppCommandArgCount(); // read up to arguments - while (nPos < rtl_getAppCommandArgCount()) + while (nPos < nCount) { OUString arg; @@ -668,13 +669,13 @@ extern "C" int SAL_CALL main( int argc, const char * argv[] ) out( "\n> warning: service name given, will ignore location!" ); // read component params - aParams.realloc( argc - nPos ); + aParams.realloc( nCount - nPos ); OUString * pParams = aParams.getArray(); sal_Int32 nOffset = nPos; - for ( ; nPos < argc; ++nPos ) + for ( ; nPos < nCount; ++nPos ) { - pParams[nPos -nOffset] = OUString::createFromAscii( argv[nPos] ); + OSL_VERIFY( rtl_getAppCommandArg( nPos, &pParams[nPos -nOffset].pData ) == osl_Process_E_None ); } //#### create registry ##################################################################### @@ -812,11 +813,6 @@ extern "C" int SAL_CALL main( int argc, const char * argv[] ) if (xComp.is()) xComp->dispose(); - if (xRegistry.is()) - { - xRegistry->close(); - } - out( "\n" ); return nRet; } |