diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-10-10 17:20:23 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-10-10 17:22:20 +0200 |
commit | 01f27b5e5d428cc3c4aeabdcbbb8204494fbd435 (patch) | |
tree | 8d3e04122162c51197e80c91f72e2f792abba73f | |
parent | 125655ae81b408369615c25f77475ca209e4c745 (diff) |
sal: fix osl_setCommandArgs() on WNT
... was missing from 1acaa577b67158c060d2f57414f7aea86504a489.
Change-Id: I9098f4587f1c201328abbbcfb34d42f09d2e8203
-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) { |