DASH Shell discussions
 help / color / mirror / Atom feed
From: Guido Berhoerster <guido+kernel.org@berhoerster.name>
To: dash@vger.kernel.org
Subject: Re: trap bug in recent versions of dash
Date: Mon, 23 Aug 2010 12:40:48 +0200	[thread overview]
Message-ID: <20100823103617.GA9302@wopr.local.invalid> (raw)
In-Reply-To: <20100822223227.GA49760@stack.nl>

[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]

* Jilles Tjoelker <jilles@stack.nl> [2010-08-23 00:32]:
> If you want to try something, here is a patch. I have verified that the
> only change to the results of FreeBSD sh's testsuite is that the test
> builtins/break2.0 starts working (there are still 51 other broken
> tests). There is no change in output from the posh testsuite (run with
>   -C sh,posix,no-typeset,no-arrays,no-coprocs,no-herestrings,no-history
> ).
> 
> diff --git a/src/eval.c b/src/eval.c
> index d5e5c95..e484bec 100644
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -307,9 +307,9 @@ setstatus:
>  		break;
>  	}
>  out:
> -	if ((checkexit & exitstatus) ||
> -	    (pendingsigs && dotrap()) ||
> -	    (flags & EV_EXIT))
> +	if (pendingsigs)
> +		dotrap();
> +	if ((flags & EV_EXIT) || (checkexit & exitstatus))
>  		exraise(EXEXIT);
>  }

Unfortunately this seems to corrupt variables.
See the attached test script, after the TERM signal $value
is not empty anymore but contains garbage.

Where can I find FreeBSD's sh tests?
-- 
Guido Berhoerster

[-- Attachment #2: timed-read.sh --]
[-- Type: application/x-shellscript, Size: 353 bytes --]

  reply	other threads:[~2010-08-23 10:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11  8:06 trap bug in recent versions of dash Guido Berhoerster
2010-08-15 20:05 ` Jilles Tjoelker
2010-08-16 11:52   ` Guido Berhoerster
2010-08-22 22:32     ` Jilles Tjoelker
2010-08-23 10:40       ` Guido Berhoerster [this message]
2010-08-23 20:11         ` Jilles Tjoelker
2010-11-28  7:20       ` Herbert Xu
2010-11-28  7:19 ` Herbert Xu
2010-11-28  8:50   ` Guido Berhoerster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100823103617.GA9302@wopr.local.invalid \
    --to=guido+kernel.org@berhoerster.name \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox