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: [PATCH] devel: fix segfault by unset 'assoc[${x[0]}]'

2021-10-06 Thread Koichi Murase
> I'd like the default behavior to be closer to what it is when > assoc_expand_once is enabled, as I said back in March. I think it's > going to be better for users in the long run. Does that mean the behavior with `assoc_expand_once' being disabled also modified in a way incompatible with older B

Re: Incorrect LINENO with exported nested functions with loops

2021-10-06 Thread Tom Coleman
I was actually incorrect about something in here. Initially I discovered the bug when this was in two scripts. I've discovered that it is actually much simpler and nothing to do with exporting functions. Updated script is below. >From examination I've done to date, using BASH 5.1.8, each function

Re: Incorrect LINENO with exported nested functions with loops

2021-10-06 Thread L A Walsh
On 2021/10/05 16:25, Tom Coleman wrote Repeat-By: Below is a sample script to replicate the bug in LINENO. --- 1st prob: scrip doesn't work as is. /tmp/lnno /tmp/lnno: line 23: syntax error near unexpected token `done' /tmp/lnno: line 23: ` done' added the line numbers inde

Re: [PATCH] devel: fix segfault by unset 'assoc[${x[0]}]'

2021-10-06 Thread Chet Ramey
On 10/5/21 10:39 PM, Koichi Murase wrote: >> You're right, there should be no `nesting' considered at all. By the time >> unbind_array_element is called, since it's only called from unset_builtin, >> the word and subscript should have already undergone all the expansion >> they're going to. There

Re: [PATCH] 4.0..devel: fix a problem that unset 'a[`echo 0`]' causes "bad array subscript" error

2021-10-06 Thread Chet Ramey
On 10/5/21 10:48 PM, Koichi Murase wrote: > [ I initially intended to submit this report after the previous report > at https://lists.gnu.org/archive/html/bug-bash/2021-10/msg00051.html > has been settled. I decided to submit this patch now because a > problem related to this report is mentioned i