Re: [BUG] ${#v} aborts string processing

2018-11-27 Thread Herbert Xu
Martijn Dekker wrote: > Another bug introduced by 3cd5386, and not fixed in current git. > String length expansion ${#v} aborts string processing. > > $ ./dash -c 'v=abc; echo ab${#v}cd' > ab3 > > Expected output: ab3cd This should be fixed by

[BUG] exit status of subshells in traps is always 0

2018-11-27 Thread Martijn Dekker
Big bad bug: it appears that subshells always return status 0 in traps. Bug found in dash 0.5.9 and later. $ src/dash -c 'trap "(false) && echo BUG" INT; kill -s INT $$' BUG $ src/dash -c 'trap "(false) && echo BUG" EXIT' BUG $ src/dash -c 'trap "(false); echo \$?" EXIT' 0 Workaround: if an