aboutsummaryrefslogtreecommitdiff
path: root/miscutils/make.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-09-14 08:59:46 +0100
committerRon Yorston <rmy@pobox.com>2024-09-14 08:59:46 +0100
commitb21546ddbea20447054e60c893b64849f54be7d9 (patch)
tree2d9127babcef813acb1c7ca60eeb7a8ba9cf3a49 /miscutils/make.c
parent0b87e69888e52ce5ca797560124564efc794414c (diff)
downloadbusybox-w32-b21546ddbea20447054e60c893b64849f54be7d9.tar.gz
busybox-w32-b21546ddbea20447054e60c893b64849f54be7d9.tar.bz2
busybox-w32-b21546ddbea20447054e60c893b64849f54be7d9.zip
make: fix test for include with no pathnames
In POSIX 2024 the behaviour of an include line with no pathnames is unspecified. The test for this condition was incorrect in certain circumstances. Files containing dependencies may be generated by the compiler and included in the makefile. On an initial build no dependency files will be present and the include line is made to ignore errors. In this case the test for no pathnames returned true, even though many pathnames may have been present. Fix the problem by always setting 'makefile' even if the named file can't be opened.
Diffstat (limited to 'miscutils/make.c')
-rw-r--r--miscutils/make.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/miscutils/make.c b/miscutils/make.c
index 1e7b77ddb..bd3b23f21 100644
--- a/miscutils/make.c
+++ b/miscutils/make.c
@@ -2083,11 +2083,11 @@ input(FILE *fd, int ilevel)
2083 make(newname(p), 1); 2083 make(newname(p), 1);
2084 opts &= ~OPT_include; 2084 opts &= ~OPT_include;
2085 } 2085 }
2086 makefile = p;
2086 if ((ifd = fopen(p, "r")) == NULL) { 2087 if ((ifd = fopen(p, "r")) == NULL) {
2087 if (!minus) 2088 if (!minus)
2088 error("can't open include file '%s'", p); 2089 error("can't open include file '%s'", p);
2089 } else { 2090 } else {
2090 makefile = p;
2091 input(ifd, ilevel + 1); 2091 input(ifd, ilevel + 1);
2092 fclose(ifd); 2092 fclose(ifd);
2093 } 2093 }