Commit 1a24b614 authored by Eric Wing's avatar Eric Wing

Exempted writable modes from bundle check on OS X since bundle areas are typically read-only.

parent a67b7bdc
...@@ -12,6 +12,12 @@ FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode) ...@@ -12,6 +12,12 @@ FILE* SDL_OpenFPFromBundleOrFallback(const char *file, const char *mode)
{ {
FILE* fp = NULL; FILE* fp = NULL;
// If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only.
if(strcmp("r", mode) && strcmp("rb", mode))
{
return fopen(file, mode);
}
NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init];
......
...@@ -12,6 +12,12 @@ FILE* Test_OpenFPFromBundleOrFallback(const char *file, const char *mode) ...@@ -12,6 +12,12 @@ FILE* Test_OpenFPFromBundleOrFallback(const char *file, const char *mode)
{ {
FILE* fp = NULL; FILE* fp = NULL;
// If the file mode is writable, skip all the bundle stuff because generally the bundle is read-only.
if(strcmp("r", mode) && strcmp("rb", mode))
{
return fopen(file, mode);
}
NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool* autorelease_pool = [[NSAutoreleasePool alloc] init];
......
...@@ -227,7 +227,6 @@ static void rwops_testFP (void) ...@@ -227,7 +227,6 @@ static void rwops_testFP (void)
/* Run read tests. */ /* Run read tests. */
#if __APPLE__ #if __APPLE__
/* Cheating: Using private API in SDL */
fp = Test_OpenFPFromBundleOrFallback( RWOPS_READ, "r" ); fp = Test_OpenFPFromBundleOrFallback( RWOPS_READ, "r" );
#else #else
fp = fopen( RWOPS_READ, "r" ); fp = fopen( RWOPS_READ, "r" );
...@@ -243,7 +242,6 @@ static void rwops_testFP (void) ...@@ -243,7 +242,6 @@ static void rwops_testFP (void)
/* Run write tests. */ /* Run write tests. */
#if __APPLE__ #if __APPLE__
/* Cheating: Using private API in SDL */
fp = Test_OpenFPFromTemporaryDir( RWOPS_WRITE, "w+" ); fp = Test_OpenFPFromTemporaryDir( RWOPS_WRITE, "w+" );
#else #else
fp = fopen( RWOPS_WRITE, "w+" ); fp = fopen( RWOPS_WRITE, "w+" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment