Skip to content

Commit

Permalink
Date: Wed, 10 May 2006 17:43:21 -0700
Browse files Browse the repository at this point in the history
From: Eric Wing
Subject: Re: Updated tarball

Attached are additional cleanups to SDLMain.m for the files in src/
main/macosx. It looks like somebody already cleaned up most of the
issues. There is one about the class interfaces being empty which
didn't look easy to fix in a meaningful way so I left them.
  • Loading branch information
slouken committed May 11, 2006
1 parent 0d18f87 commit b859db3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/macosx/SDLMain.m
Expand Up @@ -252,19 +252,24 @@ static void CustomApplicationMain (int argc, char **argv)
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
const char *temparg;
size_t arglen;
char *arg;
char **newargv;

if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;

if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE;

const char *temparg = [filename UTF8String];
size_t arglen = SDL_strlen(temparg) + 1;
char *arg = (char *) SDL_malloc(arglen);
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
arg = (char *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;

char **newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
if (newargv == NULL)
{
SDL_free(arg);
Expand Down Expand Up @@ -376,3 +381,4 @@ int main (int argc, char **argv)
#endif
return 0;
}

0 comments on commit b859db3

Please sign in to comment.