diff options
author | Paul Smith <psmith@gnu.org> | 2023-03-25 17:53:19 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2023-03-26 16:48:48 -0400 |
commit | caf1d4c28fd96f1b3efec10f3978c45e5cf57aa4 (patch) | |
tree | 52bd4e454609d31627afaa7ed098754e95c3a52e /src/job.c | |
parent | f99d0834184c97f162e965a603e88a3e10e22993 (diff) | |
download | make-git-caf1d4c28fd96f1b3efec10f3978c45e5cf57aa4.tar.gz |
Clean up expand.c
Clarify the naming and documentation on functions in src/expand.c:
- variable_expand -> expand_string
- variable_expand_string -> expand_string_buf
- variable_expand_for_file -> expand_string_for_file
- allocated_variable_expand -> allocated_expand_string
- allocated_variable_expand_for_file ->
allocated_expand_string_for_file
Change all callers to use the new names.
* src/variable.h: Rename the functions and macros.
* src/expand.c: Ditto.
* src/file.c: Use the new function names.
* src/function.c: Ditto.
* src/implicit.c: Ditto.
* src/job.c: Ditto.
* src/loadapi.c: Ditto.
* src/main.c: Ditto.
* src/read.c: Ditto.
* src/remake.c: Ditto.
* src/variable.c: Ditto.
* src/vpath.c: Ditto.
* src/w32/subproc/sub_proc.c: Ditto.
Diffstat (limited to 'src/job.c')
-rw-r--r-- | src/job.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1782,8 +1782,8 @@ new_job (struct file *file) /* Finally, expand the line. */ cmds->fileinfo.offset = i; - lines[i] = allocated_variable_expand_for_file (cmds->command_lines[i], - file); + lines[i] = allocated_expand_string_for_file (cmds->command_lines[i], + file); } cmds->fileinfo.offset = 0; @@ -1882,7 +1882,7 @@ new_job (struct file *file) nm, c->file->name); else { - char *newer = allocated_variable_expand_for_file ("$?", c->file); + char *newer = allocated_expand_string_for_file ("$?", c->file); if (newer[0] != '\0') { OSSS (message, 0, _("%s: update target '%s' due to: %s"), @@ -3637,7 +3637,7 @@ construct_command_argv (char *line, char **restp, struct file *file, int save = warn_undefined_variables_flag; warn_undefined_variables_flag = 0; - shell = allocated_variable_expand_for_file ("$(SHELL)", file); + shell = allocated_expand_string_for_file ("$(SHELL)", file); #if MK_OS_W32 /* * Convert to forward slashes so that construct_command_argv_internal() @@ -3700,9 +3700,9 @@ construct_command_argv (char *line, char **restp, struct file *file, /* In POSIX mode we default to -ec, unless we're ignoring errors. */ shellflags = xstrdup (ANY_SET (cmd_flags, COMMANDS_NOERROR) ? "-c" : "-ec"); else - shellflags = allocated_variable_expand_for_file (var->value, file); + shellflags = allocated_expand_string_for_file (var->value, file); - ifs = allocated_variable_expand_for_file ("$(IFS)", file); + ifs = allocated_expand_string_for_file ("$(IFS)", file); warn_undefined_variables_flag = save; } |