make/src
Dmitry Goncharov 8c2aa889bb [SV 62324] Simplify set_file_variables by passing in the stem
Previously we always used the file->stem value as our stem in
set_file_variables(); when that wasn't correct we had to temporarily
set that value while the function was called, then reset it afterward.
This led to issues (for example when we assumed the stem was a cached
string but it wasn't).

Avoid this by passing in the stem as an argument so that different
values can be provided.

Add tests to verify this.

* src/commands.c (set_file_variables): Take second parameter stem to
relieve the callers of set_file_variables() from setting/restoring
file->stem.
* src/commands.h (set_file_variables): Ditto.
(execute_file_commands): Pass file->stem to set_file_variables().
* src/file.c (expand_deps): Pass d->stem to set_file_variables() and
remove set and restore of file->stem.
* src/implicit.c (pattern_search): Pass stem to set_file_variables()
and remove set and restore of file->stem.
* tests/scripts/features/se_explicit: Add new tests.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/se_statpat: Ditto.
* tests/scripts/variables/automatic: Ditto.
2022-04-24 10:39:32 -04:00
..
w32 * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
amiga.c Remove extraneous characters from fatal() calls 2022-02-27 18:01:13 -05:00
amiga.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
ar.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
arscan.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
commands.c [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
commands.h [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
config.ami.template * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
config.h-vms.template * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
config.h.W32.template * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
configh.dos.template * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
debug.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
default.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
dep.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
dir.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
expand.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
file.c [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
filedef.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
function.c Ensure buffers are large enough for integer values 2022-02-21 09:29:41 -05:00
getopt1.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
getopt.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
getopt.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
gettext.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
gmk-default.scm * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
gnumake.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
guile.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
hash.c Clean up a few Windows build warnings (not all!) 2021-09-05 21:09:27 -04:00
hash.h Rework directory structure to use GNU-recommended "src" directory. 2017-11-19 14:07:22 -05:00
implicit.c [SV 62324] Simplify set_file_variables by passing in the stem 2022-04-24 10:39:32 -04:00
job.c [SV 62145] Remove a stdin temp file on re-exec failure. 2022-04-24 10:39:32 -04:00
job.h [SV 62145] Remove a stdin temp file on re-exec failure. 2022-04-24 10:39:32 -04:00
load.c Remove extraneous characters from fatal() calls 2022-02-27 18:01:13 -05:00
loadapi.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
main.c [SV 62145] Remove a stdin temp file on re-exec failure. 2022-04-24 10:39:32 -04:00
makeint.h Ensure buffers are large enough for integer values 2022-02-21 09:29:41 -05:00
misc.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
os.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
output.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
output.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
posixos.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
read.c * src/read.c (check_specials): [SV 62171] Reset ARFLAGS under .POSIX 2022-04-24 10:39:32 -04:00
remake.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
remote-cstms.c * src/commands.h: [SV 62213] Forward-declare struct file / child 2022-04-24 10:39:32 -04:00
remote-stub.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
rule.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
rule.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
signame.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
strcache.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
variable.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
variable.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
version.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vms_exit.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vms_export_symbol.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vms_progname.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vmsdir.h * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vmsfunctions.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vmsify.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vmsjobs.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00
vpath.c * <all>: Update copyright notices. 2022-02-10 14:48:26 -05:00