diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/security.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx index a7c32a963f3b..3dff65426221 100644 --- a/sal/osl/unx/security.cxx +++ b/sal/osl/unx/security.cxx @@ -22,6 +22,12 @@ #include <cstddef> #include <limits> +#ifdef IOS +#include <premac.h> +#import <Foundation/Foundation.h> +#include <postmac.h> +#endif + #include "system.h" #include <osl/security.h> @@ -324,6 +330,19 @@ static bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirec } #endif +#ifdef IOS + { + // Let's pretend the app-specific "Documents" directory is the home directory for now + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *userDirectory = [paths objectAtIndex:0]; + if ([userDirectory length] < nMax) + { + strcpy(pszDirectory, [userDirectory UTF8String]); + return sal_True; + } + } +#endif + /* if current user, check also environment for HOME */ if (getuid() == pSecImpl->m_pPasswd.pw_uid) { |