[Libreoffice-commits] core.git: sal/osl

Michael Stahl mstahl at redhat.com
Thu Oct 10 08:25:38 PDT 2013


 sal/osl/w32/process.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 01f27b5e5d428cc3c4aeabdcbbb8204494fbd435
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Oct 10 17:20:23 2013 +0200

    sal: fix osl_setCommandArgs() on WNT
    
    ... was missing from 1acaa577b67158c060d2f57414f7aea86504a489.
    
    Change-Id: I9098f4587f1c201328abbbcfb34d42f09d2e8203

diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx
index 6d55249..0328a4f 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)
     {


More information about the Libreoffice-commits mailing list