From 6e0a6b7e5d8960c176aa18cb45819f7108df4ae3 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 15 Feb 2023 21:29:09 +0000 Subject: ash: skip CR when detecting end of here document The change introduced by commit 4b894b60a (ash: change CRLF handling) failed to detect the end of a here document with a CRLF line ending. Add the necessary check. --- shell/ash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 94eb49d79..e185c3b7f 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -13708,7 +13708,7 @@ checkend: { c = pgetc(); } - if (c == '\n' || c == PEOF) { + if (c == '\n' || c == PEOF || (ENABLE_ASH_IGNORE_CR && c == '\r')) { c = PEOF; if (trap_depth == 0) g_parsefile->linno++; -- cgit v1.2.3-55-g6feb