From 8a034746323b2fc8227976705cc9f5489de3c1e7 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 2 Mar 2005 18:38:20 +0000 Subject: [PATCH] oops, forgot one more fix! git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1255 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/save.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/C/save.c b/C/save.c index 33c0665d2..54504aa23 100644 --- a/C/save.c +++ b/C/save.c @@ -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;