diff options
author | Dmitry Goncharov <dgoncharov@users.sf.net> | 2022-09-10 22:42:28 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2022-09-10 22:42:28 -0400 |
commit | 77734be2af9bf7f99d4014e26e6505c37f8012cf (patch) | |
tree | c174ac3fe6884628d1a9486f603cf125d30c318b /src/load.c | |
parent | 820210ab8508955130a7618195ad8abb53c8171d (diff) | |
download | make-git-77734be2af9bf7f99d4014e26e6505c37f8012cf.tar.gz |
[SV 63044] load: Update .LOADED if the setup function returns -1
* src/load.c (load_file): Update .LOADED if setup returns non-0.
* tests/scripts/features/load: Change the return value based on an
environment variable. Ensure that returning -1 still adds to
.LOADED. Also add a test that verifies that make doesn't try to
rebuild the loaded file if -1 is returned.
Diffstat (limited to 'src/load.c')
-rw-r--r-- | src/load.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -211,8 +211,9 @@ load_file (const floc *flocp, const char **ldname, int noerror) /* Invoke the symbol. */ r = (*symp) (flocp); - /* If it succeeded, add the load file to the loaded variable. */ - if (r > 0) + /* If it succeeded, add the load file to the loaded variable. + Anything other than 0, including -1, is a success. */ + if (r) { size_t loadlen = strlen (loaded); char *newval = alloca (loadlen + strlen (*ldname) + 2); |