Re: Incorrect LINENO with exported nested functions with loops

2021-10-07 Thread Tom Coleman
AM Chet Ramey wrote: > On 10/7/21 12:58 AM, Tom Coleman wrote: > > I did some experimenting and am confident on the fix. I don't know how to > > supply a patch suggestion officially, but have pasted it below. Four > lines > > in parse.y need deleting. Arith

Re: Incorrect LINENO with exported nested functions with loops

2021-10-06 Thread Tom Coleman
I did some experimenting and am confident on the fix. I don't know how to supply a patch suggestion officially, but have pasted it below. Four lines in parse.y need deleting. Arithmetic for loops should NOT be decrementing the 'word_top' variable, they do not make use of it. This also has flow on t

Re: Incorrect LINENO with exported nested functions with loops

2021-10-06 Thread Tom Coleman
done } bad_lineno() { for k in 1; do for ((l=3; l<=3; l++)); do : done done } set -x echo "for i in 1 line number should be 9 and is" good_lineno echo "for k in 1 line number should be 16 but is not" bad_lineno On Thu, Oct 7, 2021 at 7:43 AM L A Walsh wrote

Incorrect LINENO with exported nested functions with loops

2021-10-05 Thread Tom Coleman
Example output with first 'j' loop uncommented: $ bash run.sh +L20 + setup +L9 + export -f DO_BACKUP +L21 + run +L12 + for i in 1 +L13 + for j in 1 +L15 + true Example output with the second 'j' loop uncommented: $ bash run.sh +L20 + setup +L9 + export -f DO_BACKUP +L21 + run +L5 + for i in 1 +L14 + (( j=1 )) +L14 + (( j<=1 )) +L15 + true +L14 + (( j++ )) +L14 + (( j<=1 )) Regards, Tom Coleman