Re: [PATCH] fix for loop assignments to nameref control vars

2017-02-22 Thread Chet Ramey
On 2/22/17 6:47 AM, Grisha Levit wrote: > The special-case handling of namerefs as for loop control variables is > missing checks for the readonly attribute on the nameref and allows > creation of forbidden nameref self-references. Thanks for the report and fix. Chet -- ``The lyf so short, the c

Re: memory leak in case of "read -e"

2017-02-22 Thread Chet Ramey
On 2/22/17 2:33 AM, ZhangXiao wrote: > Hi Chet and experts, > > Build in command "read" with "-e" option causes memory leak. Can be > reproduced with below script and lots of input data. > > $cat script.sh > #!/bin/bash/bash > while [ 1 ]; > do > read -e data; > echo $data; > done

Re: [PATCH] Add nosort,noquote support to complete and compopt

2017-02-22 Thread Chet Ramey
On 2/22/17 8:27 AM, Grisha Levit wrote: > These are currently missing from the compspec/compopt displays: Good catch; thanks for the patch. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc.

[PATCH] Add nosort,noquote support to complete and compopt

2017-02-22 Thread Grisha Levit
These are currently missing from the compspec/compopt displays: $ complete -o noquote -o nospace -E $ complete -p -E complete -o nospace -E $ compopt -E | grep -ow 'no\w*' nospace --- builtins/complete.def | 6 ++ 1 file changed, 6 insertions(+) diff --git a/builtins/complete.def b/builtin

[PATCH] fix for loop assignments to nameref control vars

2017-02-22 Thread Grisha Levit
The special-case handling of namerefs as for loop control variables is missing checks for the readonly attribute on the nameref and allows creation of forbidden nameref self-references. $ declare -rn ref=a $ for ref in b; { :; } $ declare -p ref declare -nr ref="b" $ declare -n ref $ for ref in r

memory leak in case of "read -e"

2017-02-22 Thread ZhangXiao
Hi Chet and experts, Build in command "read" with "-e" option causes memory leak. Can be reproduced with below script and lots of input data. $cat script.sh #!/bin/bash/bash while [ 1 ]; do read -e data; echo $data; done $./script.sh The patch at the end of this mail can fix it.