aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-02-15 21:29:09 +0000
committerRon Yorston <rmy@pobox.com>2023-02-15 21:42:03 +0000
commit6e0a6b7e5d8960c176aa18cb45819f7108df4ae3 (patch)
treebc6f6398a5a1b93fec0c1198cc93773fae7410e9
parenta6c5fd4eb35a68a7a5cb01426df3f85ef0d20975 (diff)
downloadbusybox-w32-6e0a6b7e5d8960c176aa18cb45819f7108df4ae3.tar.gz
busybox-w32-6e0a6b7e5d8960c176aa18cb45819f7108df4ae3.tar.bz2
busybox-w32-6e0a6b7e5d8960c176aa18cb45819f7108df4ae3.zip
ash: skip CR when detecting end of here documentFRP-4882-g6e0a6b7e5
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.
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
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: {
13708 c = pgetc(); 13708 c = pgetc();
13709 } 13709 }
13710 13710
13711 if (c == '\n' || c == PEOF) { 13711 if (c == '\n' || c == PEOF || (ENABLE_ASH_IGNORE_CR && c == '\r')) {
13712 c = PEOF; 13712 c = PEOF;
13713 if (trap_depth == 0) 13713 if (trap_depth == 0)
13714 g_parsefile->linno++; 13714 g_parsefile->linno++;