Re: [PATCH] Handle line continuation in unquoted heredocs

Harald van Dijk <[email protected]> Thu, 7 Aug 2025 21:50:42 +0100
Newsgroups org.kernel.vger.dash
Message-ID <[email protected]>
On 07/08/2025 21:10, Denys Vlasenko wrote:
> Testcases:
> 
> cat <<nice
> heredoc1
> ni\
> ce
> nice # this isn't heredoc end, the end is above

Interesting. I am having trouble telling from the POSIX wording whether 
this is meant to be valid. Is this the case that "It is unspecified 
whether the line containing the trailing delimiter is itself subject to 
this line continuation." is meant to apply to, or not?

> A more simplistic apparent solution for cases 1 and 2,
> s/pgetc/pgetc_eatbnl/, breaks cases 3 and 4

Would s/pgetc/pgetc_top(synstack)/ work instead?

Cheers,
Harald van Dijk