while loop with extdebug + debug trap always returning 1

2017-04-04 Thread nesro
Hi bash-bug, I think I've found a bug in bash. I'm working on a project that skips** all commands that are going to be executed. I achieved this by a combination of a debug trap and extdebug. Once, for the entire list of commands to be executed, I'm going to execute it via eval from the debug tra

Re: while loop with extdebug + debug trap always returning 1

2017-04-04 Thread Martijn Dekker
Op 04-04-17 om 11:41 schreef nesro: > # run an empty for cycle. we can see from the output that bash ran :, then > # false and stopped to it. which is the right behavior > for (( :; false; )); do :; done This is a syntax error. 'for' takes arithmetic expressions, not shell commands. > # now run t

Re: splitting/whitespace in expansions of ${*} vs ${*/}

2017-04-04 Thread Grisha Levit
There are a few small regressions in the latest devel relative to the previous two commits but they're all rather exotic. Again, sorry if this is still WIP/too minor: CTLESC present in output (even with default IFS) $ set -- 1; unset var; printf ${var-${*:1}} | xxd : 0131

Re: splitting/whitespace in expansions of ${*} vs ${*/}

2017-04-04 Thread Chet Ramey
On 4/4/17 3:29 PM, Grisha Levit wrote: > There are a few small regressions in the latest devel relative to the > previous two commits but they're all rather exotic. Again, sorry if this > is still WIP/too minor: It is still a work in progress, but these are useful test cases. -- ``The lyf so sho

Re: while loop with extdebug + debug trap always returning 1

2017-04-04 Thread nesro
Hi Martin, thanks for reply. > > # run an empty for cycle. we can see from the output that bash ran :, then > > # false and stopped to it. which is the right behavior > > for (( :; false; )); do :; done > > This is a syntax error. 'for' takes arithmetic expressions, not shell > commands. Sorry, m

segfault evaluating [[ $@ ]] when IFS is \t or \n and $1 == $IFS

2017-04-04 Thread Grisha Levit
Given: set -- $'\t'; IFS=$1 A=$1 # or set -- $'\n' These all segfault (in different places with -DDEBUG) : ${x-$@} [[ $@ ]] : ${x-${A[@]}} [[ ${A[@]} ]]