From e8e29001ad1cdeb68a5c617db149830e676c32c8 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 26 May 2020 23:19:05 +1000 Subject: parser: Fix double-backslash nl in old-style command sub When handling backslashes within an old-style command substitution, we should not call pgetc_eatbnl because that would treat the next backslash character as another escape character if it was then followed by a new-line. This patch fixes it by calling pgetc. Reported-by: Matt Whitlock Fixes: 6bbc71d84bea ("parser: use pgetc_eatbnl() in more places") Signed-off-by: Herbert Xu --- src/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 54c2861..a47022e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1393,7 +1393,7 @@ parsebackq: { goto done; case '\\': - pc = pgetc_eatbnl(); + pc = pgetc(); if (pc != '\\' && pc != '`' && pc != '$' && (!synstack->dblquote || pc != '"')) STPUTC('\\', pout); -- cgit 1.4.1