fix case when fileName lacks "/MacOS/"
Change-Id: Ic89d1c3be1939c8989ad5ee806980e8904f8e44d
Reviewed-on: https://gerrit.libreoffice.org/24069
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index 030afe4..8530e73 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -270,8 +270,9 @@ static OUString & getIniFileName_Impl()
#ifdef MACOSX
// We keep only executables in the MacOS folder, and all
// rc files in LIBO_ETC_FOLDER (typically "Resources").
sal_Int32 p = fileName.lastIndexOf( "/MacOS/" );
fileName = fileName.replaceAt( p+1, strlen("MacOS"), LIBO_ETC_FOLDER );
sal_Int32 off = fileName.lastIndexOf( "/MacOS/" );
if ( off != -1 )
fileName = fileName.replaceAt( off + 1, strlen("MacOS"), LIBO_ETC_FOLDER );
#endif
}
#endif