fix argv[0] discovery.

This commit is contained in:
Vítor Santos Costa
2013-01-13 17:55:13 +00:00
parent ec37045ca3
commit 798afc81c4
16 changed files with 89 additions and 30 deletions

View File

@@ -54,8 +54,8 @@ this code is no being maintained anymore
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
register char *cp, *cp2;
struct stat stbuf;
@@ -94,7 +94,7 @@ Yap_FindExecutable(char *name)
strcpy(LOCAL_FileNameBuf, GLOBAL_argv[0]);
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
if (oktox(GLOBAL_Executable))
return;
return GLOBAL_Executable;
else
Yap_Error(SYSTEM_ERROR,MkAtomTerm(Yap_LookupAtom(GLOBAL_Executable)),
"cannot find file being executed");