# HG changeset patch # User Eric Wing # Date 1273319537 25200 # Node ID 8f73f4a3c972edb7ab0db1e8426727bd79a168a2 # Parent 2efcb52ba90a6f27d3f080150fef1495023fc1b2 Exempted writable modes from bundle check on OS X since bundle areas are typically read-only. diff -r 2efcb52ba90a -r 8f73f4a3c972 src/file/cocoa/SDL_rwopsbundlesupport.m --- a/src/file/cocoa/SDL_rwopsbundlesupport.m Sat May 08 01:12:55 2010 -0700 +++ b/src/file/cocoa/SDL_rwopsbundlesupport.m Sat May 08 04:52:17 2010 -0700 @@ -12,6 +12,12 @@ { 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]; diff -r 2efcb52ba90a -r 8f73f4a3c972 test/automated/rwops/Test_rwopsbundlesupport.m --- a/test/automated/rwops/Test_rwopsbundlesupport.m Sat May 08 01:12:55 2010 -0700 +++ b/test/automated/rwops/Test_rwopsbundlesupport.m Sat May 08 04:52:17 2010 -0700 @@ -12,6 +12,12 @@ { 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]; diff -r 2efcb52ba90a -r 8f73f4a3c972 test/automated/rwops/rwops.c --- a/test/automated/rwops/rwops.c Sat May 08 01:12:55 2010 -0700 +++ b/test/automated/rwops/rwops.c Sat May 08 04:52:17 2010 -0700 @@ -227,7 +227,6 @@ /* Run read tests. */ #if __APPLE__ - /* Cheating: Using private API in SDL */ fp = Test_OpenFPFromBundleOrFallback( RWOPS_READ, "r" ); #else fp = fopen( RWOPS_READ, "r" ); @@ -243,7 +242,6 @@ /* Run write tests. */ #if __APPLE__ - /* Cheating: Using private API in SDL */ fp = Test_OpenFPFromTemporaryDir( RWOPS_WRITE, "w+" ); #else fp = fopen( RWOPS_WRITE, "w+" );