1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Better error messages when opening include files

git-svn-id: svn://svn.cc65.org/cc65/trunk@83 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2000-06-14 21:07:58 +00:00
parent aa8737733f
commit 4b1abd7cc9
4 changed files with 5 additions and 7 deletions

View File

@ -38,7 +38,6 @@
#if defined(_MSC_VER)
/* Microsoft compiler */
# include <io.h>
# define R_OK 4
#else
/* Anyone else */
# include <unistd.h>
@ -137,10 +136,10 @@ static char* Find (const char* Path, const char* File)
strcpy (PathName + Count, File);
/* Check if this file exists */
if (access (PathName, R_OK) == 0) {
if (access (PathName, 0) == 0) {
/* The file exists */
return xstrdup (PathName);
}
}
/* Skip a list separator if we have one */
if (*P == ';') {

View File

@ -101,7 +101,7 @@ static char* ErrMsg [ERR_COUNT-1] = {
"`\"' or `<' expected",
"Missing terminator or name too long",
"Include file `%s' not found",
"Open failure on include file `%s'",
"Cannot open include file `%s': %s",
"Invalid #error directive",
"#error: %s",
"Unexpected `#endif'",

View File

@ -38,7 +38,6 @@
#if defined(_MSC_VER)
/* Microsoft compiler */
# include <io.h>
# define R_OK 4
#else
/* Anyone else */
# include <unistd.h>
@ -138,7 +137,7 @@ static char* Find (const char* Path, const char* File)
strcpy (PathName + Count, File);
/* Check if this file exists */
if (access (PathName, R_OK) == 0) {
if (access (PathName, 0) == 0) {
/* The file exists */
return xstrdup (PathName);
}

View File

@ -156,7 +156,7 @@ void OpenIncludeFile (const char* Name, unsigned DirSpec)
F = fopen (N, "r");
if (F == 0) {
/* Error opening the file */
PPError (ERR_INCLUDE_OPEN_FAILURE, N);
PPError (ERR_INCLUDE_OPEN_FAILURE, N, strerror (errno));
xfree (N);
return;
}