Blame SOURCES/0044-Do-not-create-paths-starting-when-root-is-just.patch

f0633d
From 2e01c8727ac2652563dd4f0c45be4aa957136be8 Mon Sep 17 00:00:00 2001
f0633d
From: Stephan Bergmann <sbergman@redhat.com>
f0633d
Date: Fri, 6 Dec 2013 16:52:27 +0100
f0633d
Subject: [PATCH 044/109] Do not create paths starting "//" when root is just
f0633d
 "/"
f0633d
f0633d
(cherry picked from commit bd8b3be0c7535e74ca8b63969be5c2bece0d3a3b)
f0633d
Conflicts:
f0633d
	configmgr/source/access.cxx
f0633d
f0633d
Change-Id: If0b413a4fdd93465074548c7ea5451288c1d12aa
f0633d
Reviewed-on: https://gerrit.libreoffice.org/6961
f0633d
Reviewed-by: Eike Rathke <erack@redhat.com>
f0633d
Tested-by: Eike Rathke <erack@redhat.com>
f0633d
---
f0633d
 configmgr/source/access.cxx | 9 +++++----
f0633d
 1 file changed, 5 insertions(+), 4 deletions(-)
f0633d
f0633d
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
f0633d
index 9f18e8f..aa04a94 100644
f0633d
--- a/configmgr/source/access.cxx
f0633d
+++ b/configmgr/source/access.cxx
f0633d
@@ -565,14 +565,15 @@ OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
f0633d
     checkLocalizedPropertyAccess();
f0633d
     // For backwards compatibility, return an absolute path representation where
f0633d
     // available:
f0633d
-    OUStringBuffer path;
f0633d
+    OUString rootPath;
f0633d
     rtl::Reference< RootAccess > root(getRootAccess());
f0633d
     if (root.is()) {
f0633d
-        path.append(root->getAbsolutePathRepresentation());
f0633d
+        rootPath = root->getAbsolutePathRepresentation();
f0633d
     }
f0633d
     OUString rel(getRelativePathRepresentation());
f0633d
-    if (path.getLength() != 0 && !rel.isEmpty()) {
f0633d
-        path.append(sal_Unicode('/'));
f0633d
+    OUStringBuffer path(rootPath);
f0633d
+    if (!rootPath.isEmpty() && rootPath != "/" && !rel.isEmpty()) {
f0633d
+        path.append('/');
f0633d
     }
f0633d
     path.append(rel);
f0633d
     return path.makeStringAndClear();
f0633d
-- 
f0633d
1.8.4.2
f0633d