make cd/1 complain on finding a wrong directory.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@554 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-06-26 05:17:14 +00:00
parent 778d99255f
commit 73cfb5f100

View File

@ -1783,7 +1783,16 @@ p_cd (void)
#if __simplescalar__
strncpy(yap_pwd,FileNameBuf2,YAP_FILENAME_MAX);
#endif
return (!chdir (FileNameBuf2));
if (chdir (FileNameBuf2) < 0) {
#if HAVE_STRERROR
Error(SYSTEM_ERROR, t1,
"cd(%s): %s", FileNameBuf2, strerror(errno));
#else
Error(SYSTEM_ERROR,t1,"cd(%s)", FileNameBuf2);
#endif
return(FALSE);
}
return(TRUE);
#else
#ifdef MACYAP
Term t1 = Deref (ARG1);