desktop/source/app/updater.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit acf00a90166bd17198e5b3c9fb2417dd0bd45deb
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Dec 13 09:58:29 2023 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Thu Dec 14 08:07:32 2023 +0100

    Fix number of actual arguments
    
    Change-Id: I04bb3462948aeab24d46ee7ee910fdae8da2aa65
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160674
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    (cherry picked from commit 8adfdb2a6dad7b6d67c1557c2a0160a53eec7cfe)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160649

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 5596028b0f79..fa3836596cc3 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -165,7 +165,7 @@ void createStr(const OUString& rStr, CharT** pArgs, size_t 
i)
     pArgs[i] = pStr;
 }
 
-CharT** createCommandLine()
+CharT** createCommandLine(int * argc)
 {
     OUString aInstallDir = Updater::getInstallationPath();
 
@@ -231,6 +231,7 @@ CharT** createCommandLine()
 
     pArgs[nArgs - 1] = nullptr;
 
+    *argc = nArgs - 1;
     return pArgs;
 }
 
@@ -297,7 +298,8 @@ bool update()
     OUString aUpdaterPath = getPathFromURL(aTempDirURL + "/" + 
OUString::fromUtf8(pUpdaterName));
 
     Updater::log("Calling the updater with parameters: ");
-    CharT** pArgs = createCommandLine();
+    int argc;
+    CharT** pArgs = createCommandLine(&argc);
 
     bool bSuccess = true;
     const char* pUpdaterTestReplace = std::getenv("LIBO_UPDATER_TEST_REPLACE");
@@ -311,7 +313,7 @@ bool update()
             bSuccess = false;
         }
 #elif defined(_WIN32)
-        bSuccess = WinLaunchChild((wchar_t*)aUpdaterPath.getStr(), 8, pArgs);
+        bSuccess = WinLaunchChild((wchar_t*)aUpdaterPath.getStr(), argc, 
pArgs);
 #endif
     }
     else

Reply via email to