1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-29 10:29:30 +00:00

.incbin did not honor the include search path

git-svn-id: svn://svn.cc65.org/cc65/trunk@1996 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2003-02-26 23:17:42 +00:00
parent f80a5148bd
commit 0fd653c416

View File

@ -7,9 +7,9 @@
/* */
/* */
/* (C) 1998-2003 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
/* Römerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
@ -45,6 +45,7 @@
#include "coll.h"
#include "symdefs.h"
#include "tgttrans.h"
#include "xmalloc.h"
/* ca65 */
#include "condasm.h"
@ -53,6 +54,7 @@
#include "expr.h"
#include "feature.h"
#include "global.h"
#include "incpath.h"
#include "instr.h"
#include "listing.h"
#include "macpack.h"
@ -880,8 +882,21 @@ static void DoIncBin (void)
/* Try to open the file */
F = fopen (Name, "rb");
if (F == 0) {
ErrorSkip (ERR_CANNOT_OPEN_INCLUDE, Name, strerror (errno));
return;
/* Search for the file in the include directories. */
char* PathName = FindInclude (Name);
if (PathName == 0 || (F = fopen (PathName, "r")) == 0) {
/* Not found or cannot open, print an error and bail out */
ErrorSkip (ERR_CANNOT_OPEN_INCLUDE, Name, strerror (errno));
}
/* Free the allocated memory */
xfree (PathName);
/* If we had an error before, bail out now */
if (F == 0) {
return;
}
}
/* Get the size of the file */