summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorDouglas Mencken <dougmencken@gmail.com>2016-04-13 20:54:48 -0400
committerStephan Bergmann <sbergman@redhat.com>2016-04-15 08:19:12 +0000
commit766280b8ebbb61d4c06828322575911839adb7ce (patch)
tree9ac5e3301e767bb836335a5da125ad608165563b /sal
parent494bd08c48c40d6ddd807e0ec40a315786e93975 (diff)
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>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/bootstrap.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index 030afe4e5897..8530e73c2159 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