summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-01 09:56:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-02 10:21:57 +0200
commit05e037a9f104bba0749bd3c75d36ba581ea663cf (patch)
tree9a23c044e6d6b536423e1bb990bdecad797f9568 /sal
parent2b73edefe21c6f70e49edba5e198dd1345d6df96 (diff)
fix --enable-macosx-sandbox build
after commit eecc113e6f6e51e5e37059235c1069dc9c4c1cc8 Date: Sat May 21 08:30:29 2022 +0200 rtl_String->OString in sal Change-Id: I1b71858ae39ae3551a281b0fa5c47652f5bc1b3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/uunxapi.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index 0aff1e469e04..5311bc71917f 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -363,7 +363,7 @@ int osl::mkdir(const OString& path, mode_t mode)
int open_c(const OString& path, int oflag, int mode)
{
- accessFilePathState *state = prepare_to_access_file_path(cpPath);
+ accessFilePathState *state = prepare_to_access_file_path(path.getStr());
int result = open(path.getStr(), oflag, mode);
int saved_errno = errno;
@@ -382,9 +382,10 @@ int open_c(const OString& path, int oflag, int mode)
// scoped bookmark for it so that we can access the file in
// the future, too. (For the "Recent Files" functionality.)
const char *sandbox = [NSHomeDirectory() UTF8String];
- if (!(strncmp(sandbox, cpPath, strlen(sandbox)) == 0 &&
- cpPath[strlen(sandbox)] == '/'))
+ if (!(strncmp(sandbox, path.getStr(), strlen(sandbox)) == 0 &&
+ path[strlen(sandbox)] == '/'))
{
+ auto cpPath = path.getStr();
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:cpPath]];
NSData *data = [url bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope
includingResourceValuesForKeys:nil
@@ -399,7 +400,7 @@ int open_c(const OString& path, int oflag, int mode)
}
#endif
- done_accessing_file_path(path, state);
+ done_accessing_file_path(path.getStr(), state);
errno = saved_errno;