Re: [PATCH] Use size_t for variable list size and length

2012-12-02 Thread Roman Rakus
On 12/01/2012 02:47 AM, Chet Ramey wrote: On 11/29/12 5:07 AM, Roman Rakus wrote: see https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow I've actually read this. I'm skeptical that this change has any pract

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Roman Rakus
On 12/01/2012 04:41 PM, Ulf Magnusson wrote: GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) Take the following example, assumed to be run in an empty directory: $ mkdir a $ echo ** a $ echo **/** a a $ echo **/**/** a a a I would expect the result to be just 'a' in all cases. You

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Ulf Magnusson
On Sun, Dec 2, 2012 at 4:58 PM, Roman Rakus wrote: > On 12/01/2012 04:41 PM, Ulf Magnusson wrote: >> >> GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) >> >> Take the following example, assumed to be run in an empty directory: >> >> $ mkdir a >> $ echo ** >> a >> $ echo **/** >> a a >> $

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Ulf Magnusson
On Sun, Dec 2, 2012 at 5:40 PM, Ulf Magnusson wrote: > On Sun, Dec 2, 2012 at 4:58 PM, Roman Rakus wrote: >> On 12/01/2012 04:41 PM, Ulf Magnusson wrote: >>> >>> GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) >>> >>> Take the following example, assumed to be run in an empty directory: >>

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Ulf Magnusson
On Sun, Dec 2, 2012 at 5:42 PM, Ulf Magnusson wrote: > On Sun, Dec 2, 2012 at 5:40 PM, Ulf Magnusson wrote: >> On Sun, Dec 2, 2012 at 4:58 PM, Roman Rakus wrote: >>> On 12/01/2012 04:41 PM, Ulf Magnusson wrote: GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) Take the

IFS is ignored for nested functions with stdin redirection

2012-12-02 Thread Andrey Borzenkov
I hit this problem in DKMS code and could reduce it to the following example: == #!/bin/bash oifs=$IFS inner () { echo a/b/c/d exit 0 } outer() { for i in 1; do IFS=/ read m v k a < <(IFS=$oifs inner) echo $m:$v:$k:$a done } outer for j in 1; do IFS=: read

Re: IFS is ignored for nested functions with stdin redirection

2012-12-02 Thread Andrey Borzenkov
В Sun, 2 Dec 2012 20:52:00 +0400 Andrey Borzenkov пишет: > I hit this problem in DKMS code and could reduce it to the following > example: > > == > #!/bin/bash > > oifs=$IFS > > inner () { > echo a/b/c/d > exit 0 > } > > outer() { > for i in 1; do > IFS=/ read m v k a <

Re: Some globstar patterns produce duplicate entries and a null filename

2012-12-02 Thread Roman Rakus
On 12/02/2012 05:57 PM, Ulf Magnusson wrote: Oh - you need to enable 'globstar', not 'extglob'.:) /Ulf Yes, you're right. Bash incorrectly expands to empty string and duplicated results. RR

Re: IFS is ignored for nested functions with stdin redirection

2012-12-02 Thread Chet Ramey
On 12/2/12 11:52 AM, Andrey Borzenkov wrote: > I hit this problem in DKMS code and could reduce it to the following > example: Thanks for the report. The problem has to do with state in the process substitution subshell preventing it from using the temporary environment for variable lookups. It