oops, forgot one more fix!

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1255 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2005-03-02 18:38:20 +00:00
parent f11ab09a60
commit 8a03474632
1 changed files with 12 additions and 1 deletions

View File

@ -1472,7 +1472,18 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
}
/* could not open file */
if (Yap_ErrorMessage == NULL) {
strncpy(Yap_FileNameBuf, inpf, YAP_FILENAME_MAX);
#if __simplescalar__
/* does not implement getcwd */
strncpy(Yap_FileNameBuf,yap_pwd,YAP_FILENAME_MAX);
#elif HAVE_GETCWD
if (getcwd (Yap_FileNameBuf, YAP_FILENAME_MAX) == NULL)
Yap_FileNameBuf[0] = '\0';
#else
if (getwd (Yap_FileNameBuf) == NULL)
Yap_FileNameBuf[0] = '\0';
#endif
strncat(Yap_FileNameBuf, "/", YAP_FILENAME_MAX);
strncat(Yap_FileNameBuf, inpf, YAP_FILENAME_MAX);
do_system_error(PERMISSION_ERROR_OPEN_SOURCE_SINK,"could not open saved state");
}
return FAIL_RESTORE;