]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 46995] Strip leading/trailing space from variable names
authorPaul Smith <psmith@gnu.org>
Mon, 21 Mar 2016 04:36:55 +0000 (00:36 -0400)
committerPaul Smith <psmith@gnu.org>
Wed, 23 Mar 2016 05:25:51 +0000 (01:25 -0400)
commite97159745d3359285cef535af780cd8e2b6b0791
tree756e580294134631855d7a689453aecee1ce3d3d
parent2b9dd215d588a1b9aa8eaa398e567414afaafce8
[SV 46995] Strip leading/trailing space from variable names

* makeint.h: Change MAP_SPACE to MAP_NEWLINE, and add MAP_PATHSEP
and MAP_SPACE which is now MAP_BLANK|MAP_NEWLINE.  Create
NEW_TOKEN(), END_OF_TOKEN(), ISBLANK(), ISSPACE() macros.
* main.c (initialize_stopchar_map): Set MAP_NEWLINE only for
newline characters.
* Convert all uses of isblank() and isspace() to macros.
* Examine all uses of isblank() (doesn't accept newlines) and
change them wherever possible to ISSPACE() (does accept newlines).
* function.c (func_foreach): Strip leading/trailing space.
* variable.c (parse_variable_definition): Clean up.
* tests/scripts/functions/foreach: Test settings and errors.
* tests/scripts/functions/call: Rewrite to new-style.
* tests/scripts/misc/bs-nl: Add many more tests for newlines.
15 files changed:
commands.c
expand.c
function.c
implicit.c
job.c
main.c
makeint.h
misc.c
read.c
tests/scripts/functions/call
tests/scripts/functions/foreach
tests/scripts/functions/sort
tests/scripts/misc/bs-nl
variable.c
vpath.c