Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Exempted writable modes from bundle check on OS X since bundle areas …
Browse files Browse the repository at this point in the history
…are typically read-only.
  • Loading branch information
Eric Wing committed May 8, 2010
1 parent 4869aa0 commit 31f815b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/file/cocoa/SDL_rwopsbundlesupport.m
Expand Up @@ -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];


Expand Down
6 changes: 6 additions & 0 deletions test/automated/rwops/Test_rwopsbundlesupport.m
Expand Up @@ -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];


Expand Down
2 changes: 0 additions & 2 deletions test/automated/rwops/rwops.c
Expand Up @@ -227,7 +227,6 @@ static void rwops_testFP (void)

/* Run read tests. */
#if __APPLE__
/* Cheating: Using private API in SDL */
fp = Test_OpenFPFromBundleOrFallback( RWOPS_READ, "r" );
#else
fp = fopen( RWOPS_READ, "r" );
Expand All @@ -243,7 +242,6 @@ static void rwops_testFP (void)

/* Run write tests. */
#if __APPLE__
/* Cheating: Using private API in SDL */
fp = Test_OpenFPFromTemporaryDir( RWOPS_WRITE, "w+" );
#else
fp = fopen( RWOPS_WRITE, "w+" );
Expand Down

0 comments on commit 31f815b

Please sign in to comment.