Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 1, 2002
1 parent bcfb7b8 commit b96602d
Show file tree
Hide file tree
Showing 2 changed files with 433 additions and 442 deletions.
28 changes: 14 additions & 14 deletions src/main/macosx/SDLMain.m
Expand Up @@ -51,22 +51,22 @@ @implementation SDLMain
/* 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 */
}
Expand Down

0 comments on commit b96602d

Please sign in to comment.