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