[PATCH] readstr: do not clear undo list

2024-05-27 Thread Grisha Levit
The undo command fails if invoked via execute-named-command on a line from the history list: $ bash --norc -in <<< $'A\n\cPB\c_C' bash-5.3$ A bash-5.3$ AC $ bash --norc -in <<< $'A\n\cPB\exundo\nC' bash-5.3$ A bash-5.3$ ABC AFAICT the rl_maybe_replace_line in _rl_readstr_

printf %m$ and %*m$ unimplemented in Bash, but implementated in C compilers

2024-05-27 Thread porterleete
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 uname output: Linux portercomp3 6.9.1 #1-NixOS SMP PREEMPT_DYNAMIC Fri May 17 10:18:09 UTC 2024 x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version

Re: printf %m$ and %*m$ unimplemented in Bash, but implementated in C compilers

2024-05-27 Thread Collin Funk
porterleete writes: > Fix: > Either update the documentation of what printf in bash actually does. > If printf is using a standard for printf other than "what the biggest > C compilers currently do", document which standard it's using or > update it to the newest standard used by gcc and clang.

Re: printf %m$ and %*m$ unimplemented in Bash, but implementated in C compilers

2024-05-27 Thread Lawrence Velázquez
On Mon, May 27, 2024, at 8:58 PM, porterleete wrote: > The man page for printf says that for integer m, %m$ lets you > specify which argument that the conversion specification will use. > Similarly, using *m$ instead of * in a conversion specification lets > you specify which argument the * will

Re: printf %m$ and %*m$ unimplemented in Bash, but implementated in C compilers

2024-05-27 Thread Oğuz
POSIX Issue 8 will require that this feature is supported, see https://www.austingroupbugs.net/view.php?id=1592 Perhaps a future version of Bash will have it. -- Oğuz

read reads from stale buffer after interrupt

2024-05-27 Thread Oğuz
See: $ while read; do :; done