kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0067-LOK-Corner-case-with-working-dir-as.patch

f325b2
From 423505af348586c46792d2d89c05b8cb9e021928 Mon Sep 17 00:00:00 2001
f325b2
From: Jan Holesovsky <kendy@collabora.com>
f325b2
Date: Tue, 7 Jul 2015 08:40:28 +0200
f325b2
Subject: [PATCH 067/398] LOK: Corner case with working dir as '/'.
f325b2
f325b2
Change-Id: I3965966f0d3fe65389e8834d67452ac56f9df2d6
f325b2
(cherry picked from commit c4e74d50901eeaf979be4707815c1d3490b543ea)
f325b2
---
f325b2
 desktop/source/lib/init.cxx | 4 +++-
f325b2
 1 file changed, 3 insertions(+), 1 deletion(-)
f325b2
f325b2
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
f325b2
index 63fe90b585b2..aa8e27c7f48f 100644
f325b2
--- a/desktop/source/lib/init.cxx
f325b2
+++ b/desktop/source/lib/init.cxx
f325b2
@@ -172,9 +172,11 @@ static OUString getAbsoluteURL(const char* pURL)
f325b2
     // convert relative paths to absolute ones
f325b2
     OUString aWorkingDir;
f325b2
     osl_getProcessWorkingDir(&aWorkingDir.pData);
f325b2
+    if (!aWorkingDir.endsWith("/"))
f325b2
+        aWorkingDir += "/";
f325b2
 
f325b2
     try {
f325b2
-        return rtl::Uri::convertRelToAbs(aWorkingDir + "/", aURL);
f325b2
+        return rtl::Uri::convertRelToAbs(aWorkingDir, aURL);
f325b2
     }
f325b2
     catch (const rtl::MalformedUriException &)
f325b2
     {
f325b2
-- 
f325b2
2.12.0
f325b2