Mercurial > sdl-ios-xcode
diff src/main/macosx/SDLMain.m @ 390:19e73568a75c
Date: Sat, 1 Jun 2002 17:56:45 -0500
From: Darrell Walisser <dwaliss1@purdue.edu>
Subject: mac patch
In this patch:
- yuv code
- links to QuickTime
- tabs -> 4 spaces
- mouse events fix
- SDLMain path parsing fix
- BUGS updates
- some miscellaneous docs/comments/code cleanup
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 01 Jun 2002 23:05:05 +0000 |
parents | ca655a7a9d80 |
children | a7129c0083f4 |
line wrap: on
line diff
--- a/src/main/macosx/SDLMain.m Sat Jun 01 19:54:15 2002 +0000 +++ b/src/main/macosx/SDLMain.m Sat Jun 01 23:05:05 2002 +0000 @@ -51,24 +51,25 @@ /* Set the working directory to the .app's parent directory */ - (void) setupWorkingDirectory:(BOOL)shouldChdir { - char parentdir[MAXPATHLEN]; - char *c; - - strncpy ( parentdir, gArgv[0], sizeof(parentdir) ); - c = (char*) parentdir; - while (*c != '\0') /* go to end */ - c++; - - while (*c != '/') /* back up to parent */ - c--; - - *c++ = '\0'; /* cut off last part (binary name) */ - if (shouldChdir) { - assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ - assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */ + char parentdir[MAXPATHLEN]; + char *c; + + strncpy ( parentdir, gArgv[0], sizeof(parentdir) ); + c = (char*) parentdir; + + while (*c != '\0') /* go to end */ + c++; + + while (*c != '/') /* back up to parent */ + c--; + + *c++ = '\0'; /* cut off last part (binary name) */ + + assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ + assert ( chdir ("../../../") == 0 ); /* chdir to the .app's parent */ } }