summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2018-09-05 21:57:29 +0300
committerTor Lillqvist <tml@iki.fi>2018-09-05 21:57:59 +0300
commit46b2350cb303a84ffd549447d313c7ced50e7032 (patch)
tree86a526a0ba66d856b38a991de869fc774e9a5726 /desktop
parent60569747d57cb1eb5b67ec57198b7f9ab7b87fb0 (diff)
Handle passing a null pAppPath to lo_initialize() on iOS
Change-Id: I293ede0dbac4b36a1b91b86100bc11593b402d06
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 416b42f3ce04..5c89c1dbd386 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3857,6 +3857,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
::osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction >(lo_initialize),
aAppURL);
osl::FileBase::getSystemPathFromFileURL( aAppURL, aAppPath );
+#ifdef IOS
+ // The above gives something like
+ // "/private/var/containers/Bundle/Application/953AA851-CC15-4C60-A2CB-C2C6F24E6F71/Foo.app/Foo",
+ // and we want to drop the final component (the binary name).
+ sal_Int32 lastSlash = aAppPath.lastIndexOf('/');
+ assert(lastSlash > 0);
+ aAppPath = aAppPath.copy(0, lastSlash);
+#endif
}
OUString aAppURL;