mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
preproc: Add found files to the list of dependencies even when cached
This fixes the dependency listings as generated with -MD (if assembling runs in multiple passes). https://bugzilla.nasm.us/show_bug.cgi?id=3392420 gorcunov@: add missing zero byte Signed-off-by: Martin Storsjö <martin@martin.st> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
d7a5473368
commit
f283c8f5c2
@ -1574,6 +1574,14 @@ static FILE *inc_fopen(const char *file,
|
||||
hp = hash_find(&FileHash, file, &hi);
|
||||
if (hp) {
|
||||
path = *hp;
|
||||
if (path || omode != INC_NEEDED) {
|
||||
const char *name = path ? path : file;
|
||||
size_t name_len = strlen(name);
|
||||
sl = nasm_malloc(name_len + 1 + sizeof sl->next);
|
||||
memcpy(sl->str, name, name_len+1);
|
||||
sl->next = NULL;
|
||||
nasm_add_to_strlist(dhead, sl);
|
||||
}
|
||||
} else {
|
||||
/* Need to do the actual path search */
|
||||
size_t file_len;
|
||||
|
Loading…
Reference in New Issue
Block a user