diff options
Diffstat (limited to 'sal/osl/w32/process.cxx')
-rw-r--r-- | sal/osl/w32/process.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 6d55249d85db..0328a4fbc9db 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -259,11 +259,15 @@ static struct CommandArgs_Impl g_command_args = #pragma warning( push ) #pragma warning( disable: 4100 ) #endif -static rtl_uString ** osl_createCommandArgs_Impl (int argc, char **) +static rtl_uString ** osl_createCommandArgs_Impl (int & argc, char **) { int nArgs(0); LPWSTR *wargv = CommandLineToArgvW( GetCommandLineW(), &nArgs ); - assert(argc == nArgs || argc == 0 /* special case - faked */); + if (argc != nArgs) + { + assert(argc == 0 /* special case - faked */); + argc = nArgs; + } rtl_uString ** ppArgs = (rtl_uString**)rtl_allocateZeroMemory(nArgs * sizeof(rtl_uString*)); if (ppArgs != 0) @@ -372,7 +376,6 @@ oslProcessError SAL_CALL osl_getCommandArg( sal_uInt32 nArg, rtl_uString **strCo void SAL_CALL osl_setCommandArgs (int argc, char ** argv) { - OSL_ASSERT(argc > 0); osl_acquireMutex (*osl_getGlobalMutex()); if (g_command_args.m_nCount == 0) { |