From e43fd91b5165a219a4b811209c7efad17379308f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 19 Dec 2012 11:13:34 +0100 Subject: Fix for making absolute the registry arguments of the uno executable a25bec0cb20671a8a8e2eacd61138773f4275875 "Properly absolutize all registry arguments of uno executable" at least broke testtools/CustomTarget_uno_test.mk on Windows, where some -ro argument system path starting with a drive letter ("C:/...") is passed in, which rtl::Uri::convertRelToAbs mis-interprets as a URI with scheme "c". Switching to osl::FileBase::getAbsoluteFileURL started to break Linux, where osl_getAbsoluteFileURL for whatever reason calls osl::FileBase::getSystemPathFromFileURL, which in turn for whetever reason rejects relative input that starts with "/". The easiest fix that appears not to break anything else appears to be the workaround now added to osl_getAbsoluteFileURL. Change-Id: If03e7136ecc2c26a8f31e591257b1886f3ab129b --- cpputools/source/unoexe/unoexe.cxx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'cpputools/source') diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index 54d02de0b721..f657c8983fdc 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -84,12 +83,13 @@ static OUString convertToFileUrl(const OUString& fileName) if (osl_getProcessWorkingDir(&uWorkingDir.pData) != osl_Process_E_None) { OSL_ASSERT(false); } - if (!uWorkingDir.isEmpty() - && uWorkingDir[uWorkingDir.getLength() - 1] != '/') + OUString uUrlFileName; + if (FileBase::getAbsoluteFileURL(uWorkingDir, fileName, uUrlFileName) + != FileBase::E_None) { - uWorkingDir += "/"; + OSL_ASSERT(false); } - return rtl::Uri::convertRelToAbs(uWorkingDir, fileName); + return uUrlFileName; } static sal_Bool s_quiet = false; @@ -334,13 +334,6 @@ static Reference< XSimpleRegistry > openRegistry( out( ": " ); out( e.Message ); } - catch (rtl::MalformedUriException & e) - { - out( "\n> warning: cannot open registry " ); - out( rURL ); - out( ": " ); - out( e.getMessage() ); - } return Reference< XSimpleRegistry >(); } -- cgit v1.2.3