mirror of
https://github.com/mirror/make.git
synced 2026-09-06 06:35:00 +08:00
[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.
This commit is contained in:
@@ -42,6 +42,10 @@ A boy captured_by days end, has jazz_and_a midnight moon_light rise
|
||||
|
||||
run_make_test("FOO = a b\tc\rd\fe \f \f \f \f \ff
|
||||
all: ; \@echo \$(words \$(sort \$(FOO)))\n",
|
||||
'', "5\n");
|
||||
'', "6\n");
|
||||
|
||||
1;
|
||||
|
||||
### Local Variables:
|
||||
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
|
||||
### End:
|
||||
|
||||
Reference in New Issue
Block a user