A programmable completoin bug?

2011-11-29 Thread Clark J. Wang
(Tested with bash 4.2.10 and 4.1.9) [bash-4.2.10] # cat foo.compspec compspec_foo() { local cmd=$1 cur=$2 pre=$3 if [[ $cur = :* ]]; then COMPREPLY=( changed changed/IGNORE_ME ) fi } complete -F compspec_foo foo [bash-4.2.10] # source foo.compspec [bash-4.2.10] # foo :short [

Severe memleak in sequence expressions?

2011-11-29 Thread Marc Schiffbauer
Hi all, please Cc me on ansers as I am not on the list. I think I found a severe memleak in bash. I had this effect with bash 4.2.10 (Ubuntu Linux) as well as bash 4.1.9 on Gentoo Linux. To make it short: echo {0..1000}>/dev/null This makes my system starting to swap as bash will use sev

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-29 Thread Matthew Story
Re-sending in text form instead of attached gzip ... as this seems to be the prevailing style on list ... this patch discards null-bytes in the read builtin along with documentation of existing -d '' behavior and expected discard behavior without for both the man and info. (run with patch -p1)

Re: *(.*) matches wrongly when dotglob unset

2011-11-29 Thread Greg Wooledge
On Tue, Nov 29, 2011 at 10:53:10PM +0800, Yongzhi Pan wrote: > I think even if dotglob is unset *(.*) should still matches all dotfiles. ksh93 does. arc3:~$ ksh h:w$ echo *(.*) . .. .acrobat .acrorc .acrosrch .adobe .angband .aptitude ...

*(.*) matches wrongly when dotglob unset

2011-11-29 Thread Yongzhi Pan
Producing the bug: tux@dell:~$ shopt -s extglob tux@dell:~$ shopt -u dotglob tux@dell:~$ ls -d *(.*) ls: cannot access *(.*): No such file or directory tux@dell:~$ touch '*(.*)' tux@dell:~$ ls -d *(.*) *(.*) I think even if dotglob is unset *(.*) should still matches all dotfiles. Yongzhi ---

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-29 Thread Matthew Story
On Nov 29, 2011, at 9:39 AM, Chet Ramey wrote: > On 11/29/11 8:29 AM, Greg Wooledge wrote: > >> [...snip] > > It's possible to have both. You can handle matching a NUL delimiter and > skip NUL bytes in the input if the delimiter isn't NUL. This is exactly the behavior that my patch provides,

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-29 Thread Chet Ramey
On 11/29/11 8:29 AM, Greg Wooledge wrote: > There are many bash scripts in use already that rely on read -d '' to > work the way it does. Switching the behavior of -d '' and introducing > -d '\0' in its place would require rewriting all of those scripts. > > The final decision is Chet's, but los

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-29 Thread Greg Wooledge
On Mon, Nov 28, 2011 at 11:00:50PM -0500, Matthew Story wrote: > bash-4.2$ printf 'foo\0bar\0' | while read -d '' line; do echo "$line"; done > foo > bar > > I find this behavior incongruent with what I expect from setting things like > IFS to empty string (e.g. delim is every character), but it s