summaryrefslogtreecommitdiff
path: root/sal/osl
diff options
context:
space:
mode:
Diffstat (limited to 'sal/osl')
-rw-r--r--sal/osl/unx/system.cxx13
-rw-r--r--sal/osl/unx/system.mm1
2 files changed, 14 insertions, 0 deletions
diff --git a/sal/osl/unx/system.cxx b/sal/osl/unx/system.cxx
index aacd91a1290a..dee35f5c3b92 100644
--- a/sal/osl/unx/system.cxx
+++ b/sal/osl/unx/system.cxx
@@ -37,6 +37,10 @@
#define RTL_MUTEX_LOCK
#define RTL_MUTEX_UNLOCK
+#include <premac.h>
+#include <Foundation/Foundation.h>
+#include <postmac.h>
+
#else //defined(MACOSX)
static pthread_mutex_t getrtl_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -162,6 +166,15 @@ int macxp_resolveAlias(char *path, int buflen)
CFErrorRef cferror;
CFDataRef cfbookmark;
+ // Don't even try anything for files inside the app bundle. Just a
+ // waste of time.
+
+ static const char * const appBundle = [[[NSBundle mainBundle] bundlePath] UTF8String];
+
+ const size_t appBundleLen = strlen(appBundle);
+ if (strncmp(path, appBundle, appBundleLen) == 0 && path[appBundleLen] == '/')
+ return 0;
+
char *unprocessedPath = path;
if ( *unprocessedPath == '/' )
diff --git a/sal/osl/unx/system.mm b/sal/osl/unx/system.mm
new file mode 100644
index 000000000000..7495a3e73058
--- /dev/null
+++ b/sal/osl/unx/system.mm
@@ -0,0 +1 @@
+#include "system.cxx"