Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Mike Jonkmans
On Thu, Feb 01, 2024 at 08:14:34PM -0500, Chet Ramey wrote: > On 1/31/24 6:05 PM, Mike Jonkmans wrote: > > > The first sentence under EXPANSION may make you think otherwise: > >Expansion is performed on the command line after it has been split into > > words. > >There are seven kinds of e

glob-expand-word and vi-command mode

2024-02-02 Thread Mike Jonkmans
>From the manual, glob-expand-word: The word before point is treated as a pattern for pathname expansion, and the list of matching filenames is inserted, replacing the word. If a numeric argument is supplied, an asterisk is appended before pathname expansion. [ With a block cursor, `before

Re: glob-expand-word and vi-command mode

2024-02-02 Thread Greg Wooledge
On Fri, Feb 02, 2024 at 03:39:54PM +0100, Mike Jonkmans wrote: > [ mkdir test; cd test; touch file1 file2 ] > > Going into `vi-command' mode on the line `ls *' puts the cursor on the `*'. > Then `glob-expand-word' does nothing with the `*', it just inserts a space. > Resulting in `ls *' (cursor s

Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Chet Ramey
On 2/2/24 8:12 AM, Mike Jonkmans wrote: On Thu, Feb 01, 2024 at 08:14:34PM -0500, Chet Ramey wrote: On 1/31/24 6:05 PM, Mike Jonkmans wrote: The first sentence under EXPANSION may make you think otherwise: Expansion is performed on the command line after it has been split into words.

Re: heap-use-after-free in executing_line_number

2024-02-02 Thread Chet Ramey
On 1/25/24 3:23 AM, Grisha Levit wrote: If currently_executing_command was a subshell, it can end up freed by the time executing_line_number checks it. Thanks for the report. The fix is to have function_substitute save and restore this, since parse_and_execute can overwrite it. Chet -- ``The

Re: incorrect cursor position when navigating with 'ALT-b'

2024-02-02 Thread Chet Ramey
On 2/1/24 7:55 AM, Korneel Dumon wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: For a specific command, the result of navigating with 'ALT-b' to go back one word at a time ends up being wrong. If I make a change after navigating with 'ALT-b' the text looks correct

Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Chet Ramey
On 2/1/24 8:47 AM, Zachary Santer wrote: On Thu, Feb 1, 2024 at 4:00 AM Andreas Schwab wrote: The shell-expand-line function's purpose is to let you edit the expansion further. That would still leave you needing to requote the line yourself, if there was any quoting present originally. Ar

Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Mike Jonkmans
On Fri, Feb 02, 2024 at 10:09:53AM -0500, Chet Ramey wrote: > On 2/2/24 8:12 AM, Mike Jonkmans wrote: > > On Thu, Feb 01, 2024 at 08:14:34PM -0500, Chet Ramey wrote: > > "There are seven kinds of expansion..." then three sentences later comes > > quote removal. The reader may wonder whether quote r

Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Zachary Santer
First of all, I'd like to direct your attention back to the original email in this thread, by A4-Tacks: https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00132.html That looks a lot more like a bug, and I'm sorry I distracted from it with my statement questioning what shell-expand-line was doi

Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Chet Ramey
On 2/2/24 3:09 PM, Mike Jonkmans wrote: Maybe: Several kinds of expansion are performed in order: first brace expansion; then tilde expansion, parameter and variable expansion, command substitution and arithmetic expansion (done in a left-to-right fashion); word splitting; pathname expansion an

Re: About `M-C-e` expand result `'` failed

2024-02-02 Thread Chet Ramey
On 2/2/24 3:36 PM, Zachary Santer wrote: First of all, I'd like to direct your attention back to the original email in this thread, by A4-Tacks: https://lists.gnu.org/archive/html/bug-bash/2024-01/msg00132.html That looks a lot

Error with SIGCHLD trap and process substitution

2024-02-02 Thread Tavian Barnes
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wfo rmat -Werror=format-security -fstack-clash-protection -fcf-pr

Re: glob-expand-word and vi-command mode

2024-02-02 Thread Mike Jonkmans
On Fri, Feb 02, 2024 at 09:50:46AM -0500, Greg Wooledge wrote: > On Fri, Feb 02, 2024 at 03:39:54PM +0100, Mike Jonkmans wrote: > > [ mkdir test; cd test; touch file1 file2 ] > > > > Going into `vi-command' mode on the line `ls *' puts the cursor on the `*'. > > Then `glob-expand-word' does nothin

Re: [PATCH] printf: more error handling

2024-02-02 Thread Grisha Levit
On Thu, Feb 1, 2024 at 7:41 PM Chet Ramey wrote: > > On 1/22/24 9:44 PM, Grisha Levit wrote: > > The size of the buffer used for printf -v is tracked in an int but this > > can overflow since the buffer can be built up by multiple vsnprintf(3) > > calls, each of which can append up to INT_MAX byte