]> git.ipfire.org Git - thirdparty/make.git/commit
Directly handle $\ line endings
authorPaul Smith <psmith@gnu.org>
Sun, 26 Feb 2023 22:30:15 +0000 (17:30 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 26 Feb 2023 22:30:15 +0000 (17:30 -0500)
commitbf7f690202a78bc4e1588302f9ba6a10a4c273af
tree8fed826e8801230018d3deb2a0086e5422b79fed
parent5d1fe2b16db49f15fb8611e70221687cecb411bc
Directly handle $\ line endings

Previously we used the fact that this line ending expanded to "$ "
which would then expand to the empty string.  This has problems if
you enable warnings for undefined variables, so directly implement
this special (but documented) trick in the GNU Make parser.

As a side-effect this also removes all previous whitespace when
in GNU Make mode (not in POSIX mode) just as it would without "$".

* src/misc.c (collapse_continuations): Check for "$\" and remove it.
* tests/scripts/variables/flavors: Add regression tests including
with previous whitespace, and escaped/unescaped "$"
src/misc.c
tests/scripts/variables/flavors
tests/scripts/variables/negative