2022-07-26 15:52:53 +00:00
|
|
|
# $NetBSD: directive-for-null.mk,v 1.3 2022/06/12 15:03:27 rillig Exp $
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
|
|
|
# Test for parsing a .for loop that accidentally contains a null byte.
|
|
|
|
#
|
|
|
|
# As of 2020-12-19, there are 3 error messages:
|
|
|
|
#
|
|
|
|
# make: "(stdin)" line 2: Zero byte read from file
|
|
|
|
# make: "(stdin)" line 2: Unexpected end of file in for loop.
|
|
|
|
# make: "(stdin)" line 3: Zero byte read from file
|
|
|
|
#
|
|
|
|
# The one about "end of file" might be misleading but is due to the
|
2022-07-26 15:52:53 +00:00
|
|
|
# implementation. On both errors and EOF, ParseRawLine returns NULL.
|
2021-01-14 01:24:34 +00:00
|
|
|
#
|
|
|
|
# The one about the "zero byte" in line 3 is surprising since the only
|
|
|
|
# line that contains a null byte is line 2.
|
|
|
|
|
|
|
|
all: .PHONY
|
2022-07-26 15:52:53 +00:00
|
|
|
@printf '%s\n' \
|
|
|
|
'.for i in 1 2 3' \
|
|
|
|
'VAR=value' \
|
|
|
|
'.endfor' \
|
|
|
|
| tr 'l' '\0' \
|
2021-01-14 01:24:34 +00:00
|
|
|
| ${MAKE} -f -
|