summary refs log tree commit diff
path: root/src/.gitignore
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2010-04-02 13:59:42 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2010-04-02 13:59:42 +0800
commit2533d0df20e871da156d80078b79d93c8c02f0ad (patch)
tree390e780fe63ac5c7c29869d18077a4587fac8b09 /src/.gitignore
parent[BUILTIN] Use TMPDIR in mkbuiltins (diff)
downloaddash-2533d0df20e871da156d80078b79d93c8c02f0ad.tar.gz
dash-2533d0df20e871da156d80078b79d93c8c02f0ad.zip
[BUILTIN] Make trap signal name/number errors non-fatal.
On Wed, Feb 24, 2010 at 10:23:34AM +0000, Peter Kjellerstedt wrote:
>
> there seems to be a problem  with the trap implementation in dash
> (tested with 0.5.4 and 0.5.5.1). If I specify a signal which is not
> supported, the shell unconditionally aborts. E.g., I had expected
> the following to print foo (like bash and zsh do):
>
> # dash -c 'trap "echo trap executed" UNKNOWNSIGNAL || echo "foo"'
> trap: 1: UNKNOWNSIGNAL: bad trap
>
> This means I cannot write a construct like the following to take
> advantage of the ERR signal which is present in some shells:
>
> trap "echo ERR trap executed" ERR 2>/dev/null || :
>
> I also checked the POSIX documentation, and quoting from
> http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html
> (exit status): "For both interactive and non-interactive shells,
> invalid signal names [XSI] [Option Start] or numbers [Option End]
> shall not be considered a syntax error and do not cause the shell
> to abort."

This patch replaces sh_error with a outfmt + return 1 in trapcmd
so that these errors are no longer fatal.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
9-13Use nvim as MANPAGERJune McEnroe 2016-09-13Use return value of getopt in xxJune McEnroe On macOS/FreeBSD, optopt is always set after calling getopt. On Linux, optopt is only set if an unrecognized option was found. What is the point of POSIX if such behaviour can differ? 2016-09-12Compile xx.c with clang specificallyJune McEnroe 2016-09-12Prevent offset from xx when reading zeroJune McEnroe 2016-09-12Rewrite xx.cJune McEnroe 2016-09-12Fix ascii alignment in xxJune McEnroe 2016-09-12Add -s flag to xxJune McEnroe 2016-09-12Add -a flag to xxJune McEnroe 2016-09-12Add -o flag to xxJune McEnroe 2016-09-12Add -g option to xxJune McEnroe 2016-09-12Add -c option to xxJune McEnroe 2016-09-12Add .bin/xx.cJune McEnroe 2016-09-08Rename colorscheme to lameJune McEnroe 2016-09-04Simplify colors syntax in zsh promptJune McEnroe 2016-08-29Color rubyStringDelimiter as StringJune McEnroe 2016-08-24Highlight rubyDefine as StructureJune McEnroe 2016-08-23Remove scroll bindings from nvim configJune McEnroe 2016-08-17Highlight Search with black foregroundJune McEnroe 2016-08-15Remove gruvboxJune McEnroe 2016-08-04Remove march from SSH configJune McEnroe 2016-08-01Disable tab indicators in iTermJune McEnroe 2016-07-30Color PreProc DarkGreenJune McEnroe 2016-07-29Color Structure and Typedef in grayJune McEnroe 2016-07-27Color comments DarkBlue and LightBlueJune McEnroe 2016-07-27Color macros in yellowJune McEnroe 2016-07-26Colorscheme colors and schemesJune McEnroe 2016-07-26Add ''subtle'' colorschemeJune McEnroe I'm just trying this out. 2016-07-26Add htoprcJune McEnroe 2016-07-24Add may and refactor ssh configJune McEnroe 2016-07-18Disable cursorlineJune McEnroe 2016-07-18Use hard constrast gruvbox darkJune McEnroe 2016-07-15Remove vim configurationJune McEnroe 2016-07-15Add readline to README configurations listJune McEnroe 2016-07-15Add vendor script to READMEJune McEnroe 2016-07-15Pull latest pathogen and gruvboxJune McEnroe