diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-12-19 11:13:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-12-19 11:19:49 +0100 |
commit | e43fd91b5165a219a4b811209c7efad17379308f (patch) | |
tree | b6f73dc261fe704e9946a33ec2191dedf10aa6df /cpputools | |
parent | 174b6db5a01314c1651e0787272669950d1be823 (diff) |
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
Diffstat (limited to 'cpputools')
-rw-r--r-- | cpputools/source/unoexe/unoexe.cxx | 17 |
1 files changed, 5 insertions, 12 deletions
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 <rtl/process.h> #include <rtl/string.h> #include <rtl/strbuf.hxx> -#include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> #include <uno/environment.h> @@ -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 >(); } |