From 41565560250294e22fc1c21bc4bab8286255d4cc Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 27 Nov 2014 11:48:34 +0100 Subject: Make osl_getExecutableFile work even without a prior osl_setCommandArgs After 2ad716f406e0fdb9b9294876c64ae92fecbf5e27 "Revert 'pyuno: set up fake command line in getComponentContext(),'" e.g. PythonTest_sw_python would fail on Windows, where WinSalGraphics::GetDevFontList (vcl/win/source/gdi/salgdi3.cxx) calls osl_getExecutableFile and is itself called in a python process where osl_setCommandArgs has not been set up. This patch makes osl_getExecutableFile on all platforms if osl_setCommandArgs has not (yet) been set fall back to the code that was osl_bootstrap_getExecutableFile_Impl (which was called from sal/rtl/bootstrap.cxx, which can now call osl_getExecutableFile). Change-Id: I6c1bb59205041b3208c830a8b8406e28128b4566 --- sal/rtl/bootstrap.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sal/rtl') diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index f24881953770..39b7665a0be4 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -42,8 +42,6 @@ #include #include -#include "getexecutablefile.hxx" - #ifdef ANDROID #include #endif @@ -216,7 +214,7 @@ static bool getFromCommandLineArgs( static void getExecutableDirectory_Impl (rtl_uString ** ppDirURL) { OUString fileName; - osl_bootstrap_getExecutableFile_Impl (&(fileName.pData)); + osl_getExecutableFile(&(fileName.pData)); sal_Int32 nDirEnd = fileName.lastIndexOf('/'); OSL_ENSURE(nDirEnd >= 0, "Cannot locate executable directory"); @@ -254,7 +252,7 @@ static OUString & getIniFileName_Impl() } else { - osl_bootstrap_getExecutableFile_Impl (&(fileName.pData)); + osl_getExecutableFile(&(fileName.pData)); // get rid of a potential executable extension OUString progExt = ".bin"; -- cgit