[PATCH] builtin_read: count null character toward -n/-N limit

2019-02-04 Thread John Passaro
When the read builtin is invoked with -n/-N , the documentation specifies that at most characters will be read from stdin. This statement is not true when stdin emits null characters: read discards the null character and keeps reading without incrementing its counter, continuing until it has consu

Re: read -N 1

2019-02-04 Thread Chet Ramey
On 2/4/19 11:45 AM, John Passaro wrote: > Bash Version: 4.4 > Patch Level: 23 > Release Status: release > > Description: > The `read` builtin skips null characters and does not count > them toward the limit specified by -n/-N. This leads to > surprising behavior with /dev/zero:

Re: `complete -p -- ` doesn't yield reusable input when "-F" is assigned an invalid identifier

2019-02-04 Thread Chet Ramey
On 2/4/19 11:48 AM, Grisha Levit wrote: > On Sun, Jan 27, 2019 at 6:15 PM Chet Ramey wrote: >> the function name argument to -F can't contain any shell metacharacters > > Should the change [1] to make this happen have strpbrk() instead of > strcspn()? It seems to have the opposite of the intende

read -N 1

2019-02-04 Thread John Passaro
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: darwin17.5.0 Compiler: clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='darwin17.5.0' -DCONF_MACHTYPE='x86_64-apple-darwin17.5.0' -DCONF_VENDOR='apple' -DLOCALEDIR='/usr/loca

Re: `complete -p -- ` doesn't yield reusable input when "-F" is assigned an invalid identifier

2019-02-04 Thread Grisha Levit
On Sun, Jan 27, 2019 at 6:15 PM Chet Ramey wrote: > the function name argument to -F can't contain any shell metacharacters Should the change [1] to make this happen have strpbrk() instead of strcspn()? It seems to have the opposite of the intended effect as is. [1] https://git.savannah.gnu.or

Re: bash 5.0.2(1) multiline command in history bug

2019-02-04 Thread Chet Ramey
On 2/4/19 3:22 AM, Jason Vas Dias wrote: > Good day - > > Under bash 4.4.23, with emacs history editing enabled, I can do: >$ echo '1 > > 2 > > 3 > > ' > 1 > 2 > 3 >$ >and I can then press the (move-up / history-previous) key, >and the same command, inclu

bash 5.0.2(1) multiline command in history bug

2019-02-04 Thread Jason Vas Dias
Good day - Under bash 4.4.23, with emacs history editing enabled, I can do: $ echo '1 > 2 > 3 > ' 1 2 3 $ and I can then press the (move-up / history-previous) key, and the same command, including embedded new lines in the arguments, is echoed back to me,