[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: Re: [PATCH] ash: only catch unexpected exceptions in PS1 expansion
From: Denys Vlasenko <vda.linux () googlemail ! com>
Date: 2019-07-31 11:45:23
Message-ID: CAK1hOcN-MTrYkZvN7GMFtHBGPU8Fiegi9DNsAjyGOyVisMozpQ () mail ! gmail ! com
[Download RAW message or body]
Applied, thanks!
On Mon, Jul 29, 2019 at 11:00 AM Ron Yorston <rmy@pobox.com> wrote:
>
> Commit d1a2fa2a4 (ash: catch error in arithmetic expansion in PS1)
> catches all exceptions raised by expandarg(). Some exceptions, such as
> the EXEXIT raised when command expansion is used, are expected:
>
> export PS1='$(echo "$ ")'
>
> These should be processed normally or the shell hangs at the prompt.
>
> function old new delta
> expandstr 344 353 +9
> ------------------------------------------------------------------------------
> (add/remove: 0/0 grow/shrink: 1/0 up/down: 9/0) Total: 9 bytes
>
> Signed-off-by: Ron Yorston <rmy@pobox.com>
> ---
> shell/ash.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/shell/ash.c b/shell/ash.c
> index e3bbac9a0..c0352602b 100644
> --- a/shell/ash.c
> +++ b/shell/ash.c
> @@ -13126,6 +13126,8 @@ expandstr(const char *ps, int syntax_type)
> if (setjmp(jmploc.loc) == 0) {
> exception_handler = &jmploc;
> expandarg(&n, NULL, EXP_QUOTED);
> + } else if (exception_type == EXEXIT) {
> + exitshell();
> }
> exception_handler = savehandler;
> RESTORE_INT(saveint);
> --
> 2.21.0
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic