[git commit] ash: use pgetc_eatbnl() in more places, take 3
Denys Vlasenko
vda.linux at googlemail.com
Tue Sep 7 23:13:40 UTC 2021
commit: https://git.busybox.net/busybox/commit/?id=c54025612711a6b1997efd99206b9fbcaa5a29cf
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
Adding previously skipped "readtoken1(pgetc_eatbnl(), syntax_type..." change
from upstream commit:
Date: Thu Mar 8 08:37:11 2018 +0100
parser: use pgetc_eatbnl() in more places
dash has a pgetc_eatbnl function in parser.c which skips any
backslash-newline combinations. It's not used everywhere it could be.
There is also some duplicated backslash-newline handling elsewhere in
parser.c. Replace most of the calls to pgetc() with calls to
pgetc_eatbnl() and remove the duplicated backslash-newline handling.
Testcase:
PS1='\
:::'
should result in ::: prompt, not <newline>::: prompt
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
shell/ash.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shell/ash.c b/shell/ash.c
index cf62fdf75..f1c21188e 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13388,7 +13388,7 @@ expandstr(const char *ps, int syntax_type)
* PS1='$(date "+%H:%M:%S) > '
*/
exception_handler = &jmploc;
- readtoken1(pgetc(), syntax_type, FAKEEOFMARK, 0);
+ readtoken1(pgetc_eatbnl(), syntax_type, FAKEEOFMARK, 0);
n.narg.type = NARG;
n.narg.next = NULL;
More information about the busybox-cvs
mailing list