desktop/source/app/updater.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
New commits: commit 58bfd8f982950566018f77ce8895963d914058f8 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Thu Dec 14 12:15:10 2023 +0100 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Fri Dec 15 09:23:56 2023 +0100 Fix backward vs. forward slashes on Windows Change-Id: I24771a526848901ccedb15aa5dd7b373fe854977 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160765 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx index fa3836596cc3..8796583df4d8 100644 --- a/desktop/source/app/updater.cxx +++ b/desktop/source/app/updater.cxx @@ -86,7 +86,12 @@ const char* pSofficeExeName = "soffice.exe"; OUString normalizePath(const OUString& rPath) { - OUString aPath = rPath.replaceAll("//", "/"); + OUString aPath = rPath; +#if defined WNT + aPath = aPath.replace('\\', '/'); +#endif + + aPath.replaceAll("//", "/"); // remove final / if (aPath.endsWith("/")) @@ -108,7 +113,10 @@ OUString normalizePath(const OUString& rPath) aPath = aTempPath.copy(0, i) + aPath.copy(nIndex + 3); } - return aPath.replaceAll("\\", "/"); +#if defined WNT + aPath = aPath.replace('/', '\\'); +#endif + return aPath; } void CopyFileToDir(const OUString& rTempDirURL, const OUString & rFileName, const OUString& rOldDir)