Fixed bug that was causing Executor to crash on systems where argv[0] isn't guaranteed to have a slash in it (e.g., Fedora 12).

This commit is contained in:
Clifford T. Matthews 2009-12-05 08:44:07 -07:00
parent 44c8a96e32
commit 12a845ba9e

View File

@ -722,9 +722,11 @@ A1(PRIVATE, void, setstartdir, char *, argv0)
misc_self_examination (lookhere);
#endif
suffix = rindex(lookhere, '/');
if (suffix)
*suffix = 0;
getcwd(savedir, sizeof savedir);
Uchdir(lookhere);
if (suffix)
*suffix = '/';
getcwd(ROMlib_startdir, sizeof ROMlib_startdir);
Uchdir(savedir);