diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-08 01:03:57 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-09-08 01:13:40 +0200 |
commit | c54025612711a6b1997efd99206b9fbcaa5a29cf (patch) | |
tree | 0b04e03d0d33e19392ee1bfa3229b43e59a407b7 | |
parent | 1c06ddd8bbbd6906e5bf00ec93e04d5090718be9 (diff) | |
download | busybox-w32-c54025612711a6b1997efd99206b9fbcaa5a29cf.tar.gz busybox-w32-c54025612711a6b1997efd99206b9fbcaa5a29cf.tar.bz2 busybox-w32-c54025612711a6b1997efd99206b9fbcaa5a29cf.zip |
ash: use pgetc_eatbnl() in more places, take 3
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@googlemail.com>
-rw-r--r-- | shell/ash.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
13388 | * PS1='$(date "+%H:%M:%S) > ' | 13388 | * PS1='$(date "+%H:%M:%S) > ' |
13389 | */ | 13389 | */ |
13390 | exception_handler = &jmploc; | 13390 | exception_handler = &jmploc; |
13391 | readtoken1(pgetc(), syntax_type, FAKEEOFMARK, 0); | 13391 | readtoken1(pgetc_eatbnl(), syntax_type, FAKEEOFMARK, 0); |
13392 | 13392 | ||
13393 | n.narg.type = NARG; | 13393 | n.narg.type = NARG; |
13394 | n.narg.next = NULL; | 13394 | n.narg.next = NULL; |