summaryrefslogtreecommitdiff
path: root/output/codeview.c
diff options
context:
space:
mode:
authorFabian Giesen <fabiang@radgametools.com>2016-04-28 13:48:14 -0700
committerCyrill Gorcunov <gorcunov@gmail.com>2016-05-10 12:01:08 +0300
commit86d8756f0cd255e91c8ef8a4de1ebae3c18d30f3 (patch)
tree8924c617c754220356a0196c2554fe477a67deeb /output/codeview.c
parent31c97fb89e2cdf5638b863f8dc05c1041a7ddd1d (diff)
downloadnasm-86d8756f0cd255e91c8ef8a4de1ebae3c18d30f3.tar.gz
codeview: Look up %include path when determining files to hash.
The hash calculation in calc_md5 tries to open the source file via "filename" again. For %includes, this is the file name that was specified in the %include directive, not the actual name of the file that was opened by the preprocessor. In other words, this fails if the include file is not in the current working directory. Add pp_input_fopen that uses the preprocessor include path lookup code to resolve a file name and open it, and use that in codeview.c. Signed-off-by: Fabian Giesen <fabiang@radgametools.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output/codeview.c')
-rw-r--r--output/codeview.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/output/codeview.c b/output/codeview.c
index f9750bfc..571cbabe 100644
--- a/output/codeview.c
+++ b/output/codeview.c
@@ -44,6 +44,7 @@
#include "nasm.h"
#include "nasmlib.h"
+#include "preproc.h"
#include "saa.h"
#include "output/outlib.h"
#include "output/pecoff.h"
@@ -308,7 +309,7 @@ static void calc_md5(const char *const filename,
FILE *f;
MD5_CTX ctx;
- f = fopen(filename, "r");
+ f = pp_input_fopen(filename);
if (!f)
goto done;