array size vs index of last element (was Re: setarray[unsetkey] doesn't trigger nounset in arithmetic context)

2023-05-27 Thread Martin D Kealey
On Tue, 23 May 2023 at 23:32, Chet Ramey wrote: > On 5/22/23 10:56 PM, Martin D Kealey wrote: > > > For example, if one is filling an array in random order, rather than > > progressively adding to the end, then it is useful and makes sense to be > > able to ask the array for its highest index. >

No form commsub if last token ends with & or ;

2023-05-27 Thread Grisha Levit
Missing final `;': "$BASH" --pretty-print <<< $'${ : \;;}' ${ : \; } "$BASH" --pretty-print <<< $'${ : \;\n}' ${ : \; } "$BASH" --pretty-print <<< $'${ : \&;}' ${ : \& } "$BASH" --pretty-print <<< $'${ : \&\n}' ${ : \& } Correct: "$BASH" --pretty-print <<< $'${ : \;&}' ${ : \; & } "$BASH" --

Re: ctype.h functions on bytes 0x80..0xFF

2023-05-27 Thread Grisha Levit
The below seems like a cheap fix for UTF-8 locales. Since Bash falls back to using the single-byte glob matching functions when presented with invalid multibyte strings, this patch makes the glob code avoid calling the ctype functions or strcoll when handling individual bytes >0x7F (in a UTF-8 loca

Re: EOF at PS2

2023-05-27 Thread alex xmb ratchev
On Fri, May 26, 2023, 23:45 Chet Ramey wrote: > On 4/26/23 5:38 PM, Grisha Levit wrote: > > A few issues with EOF being received at PS2: > > I finally had a chance to check out the ksh88 behavior on a Solaris 10 VM. > It's pretty bizarre, but it does point to some improvements when ignoreeof > is

Re: Error message: cannot find _struct in shared object

2023-05-27 Thread Emanuele Torre
On Sat, May 27, 2023 at 09:39:18AM -0700, Wiley Young wrote: > Description: > > A syntax error on a variable assignment lead to $x being unset when `enable > -n "$x" was executed, which produced this error message: > ./test.sh: line 22: enable: cannot find _struct in shared object : > /usr/bin/b

enable builtin bugs in bash 5.2

2023-05-27 Thread Emanuele Torre
Since bash 5.2, enable mkdir is equivalent to enable -f mkdir mkdir. But, if you use the -n flag, and mkdir is not a loaded builtin, it will also be equivalent to enable -f mkdir mkdir (so the -n flag is ignored), and the newly loaded foo will be enabled instead of disabled: $ ./bash -c 'c

Error message: cannot find _struct in shared object

2023-05-27 Thread Wiley Young
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASS