Mercurial > sdl-ios-xcode
diff src/main/macosx/SDLMain.m @ 388:4e9044b378fd
*** empty log message ***
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 01 Jun 2002 19:51:08 +0000 |
parents | 50620ec9c86a |
children | ca655a7a9d80 |
line wrap: on
line diff
--- a/src/main/macosx/SDLMain.m Sat Jun 01 18:48:13 2002 +0000 +++ b/src/main/macosx/SDLMain.m Sat Jun 01 19:51:08 2002 +0000 @@ -51,22 +51,22 @@ /* 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) { + 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 */ }