Re: [PATCH] cond expr: cleanup on errors

2024-06-10 Thread Chet Ramey
On 6/4/24 3:00 PM, Grisha Levit wrote: Thanks for the report. These are interactive errors only, since a syntax error in a compound command causes the shell to exit. The fix for this you applied in [1] does seem cleaner. I think it needs also the following for something like `[[ ( -n x x ]]`:

Re: [PATCH] cond expr: cleanup on errors

2024-06-04 Thread Grisha Levit
On Mon, Jun 3, 2024 at 3:53 PM Chet Ramey wrote: > > On 5/31/24 5:07 PM, Grisha Levit wrote: > > Two minor leak fixes for conditional command error conditions: > > > > If a WORD token is read when COND_AND, COND_OR, COND_END, or a binary > > operator are expected, the allocated WORD_DESC is leaked

Re: [PATCH] cond expr: cleanup on errors

2024-06-04 Thread Chet Ramey
On 6/3/24 7:30 PM, Grisha Levit wrote: On Mon, Jun 3, 2024 at 3:53 PM Chet Ramey wrote: On 5/31/24 5:07 PM, Grisha Levit wrote: Two minor leak fixes for conditional command error conditions: If a WORD token is read when COND_AND, COND_OR, COND_END, or a binary operator are expected, the allo

Re: [PATCH] cond expr: cleanup on errors

2024-06-03 Thread Grisha Levit
On Mon, Jun 3, 2024 at 3:53 PM Chet Ramey wrote: > > On 5/31/24 5:07 PM, Grisha Levit wrote: > > Two minor leak fixes for conditional command error conditions: > > > > If a WORD token is read when COND_AND, COND_OR, COND_END, or a binary > > operator are expected, the allocated WORD_DESC is leaked

Re: [PATCH] cond expr: cleanup on errors

2024-06-03 Thread Chet Ramey
On 5/31/24 5:07 PM, Grisha Levit wrote: Two minor leak fixes for conditional command error conditions: If a WORD token is read when COND_AND, COND_OR, COND_END, or a binary operator are expected, the allocated WORD_DESC is leaked. If a conditional command has a syntax error, the allocated COMMA

[PATCH] cond expr: cleanup on errors

2024-05-31 Thread Grisha Levit
Two minor leak fixes for conditional command error conditions: If a WORD token is read when COND_AND, COND_OR, COND_END, or a binary operator are expected, the allocated WORD_DESC is leaked. If a conditional command has a syntax error, the allocated COMMAND is leaked. --- parse.y | 14 ++