I'd say that strncpy() followed by a strcat_s() is playing up:
Index: code/cfile/cfile.cpp
===================================================================
--- code/cfile/cfile.cpp (revision 5532)
+++ code/cfile/cfile.cpp (working copy)
@@ -164,6 +164,8 @@
//
int cfile_init(char *exe_dir, char *cdrom_dir)
{
+ mprintf(( "cfile_int(): exe_dir '%s'\n", exe_dir ));
+ mprintf(( "cfile_int(): cdrom_dir '%s'\n", cdrom_dir ));
int i;
// initialize encryption
Index: code/freespace2/freespace.cpp
===================================================================
--- code/freespace2/freespace.cpp (revision 5532)
+++ code/freespace2/freespace.cpp (working copy)
@@ -1951,6 +1951,7 @@
#endif
#ifdef APPLE_APP
+ mprintf(( "game_init(): full_path '%s'\n", full_path ));
// some OSX hackery to drop us out of the APP the binary is run from
char *c = NULL;
c = strstr(full_path, ".app");
@@ -1961,11 +1962,14 @@
*c = '\0';
}
strncpy(whee, full_path, MAX_PATH_LEN-1);
+ mprintf(( "game_init(): whee 1 '%s'\n", whee ));
#else
GetCurrentDirectory(MAX_PATH_LEN-1, whee);
#endif
strcat_s(whee, DIR_SEPARATOR_STR);
+ mprintf(( "game_init(): whee 2 '%s'\n", whee ));
strcat_s(whee, EXE_FNAME);
+ mprintf(( "game_init(): whee 3 '%s'\n", whee ));
//Initialize the libraries
s1 = timer_get_milliseconds();
fs2_open.log
==========================================================================
DEBUG SPEW: No debug_filter.cfg found, so only general, error, and warning
categories can be shown and no debug_filter.cfg info will be saved.
==========================================================================
Opened log '/Users/rhyskidd/Library/FS2_Open/data/fs2_open.log', Tue Aug 25 00:07:58 2009 ...
FreeSpace version: 3.6.11
Passed cmdline options:
<none>
game_init(): full_path '/Applications/Freespace 2 Open'
game_init(): whee 1 '/Applications/Freespace 2 Open'
game_init(): whee 2 '/'
game_init(): whee 3 'fs2.exe'
cfile_int(): exe_dir 'fs2.exe'
cfile_int(): cdrom_dir '(null)'
... and yes, it does seem a little contrived that we add EXE_FNAME ("fs2.exe") to the path string on ALL platforms.