Re: Completion crashes the shell

2009-03-02 Thread Chris F.A. Johnson

On Mon, 2 Mar 2009, Richard Leeden wrote:
...

Have you applied the tab completion patch that Chet provided here:
http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00153.html
http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00153.html


   I missed that. Thanks... that fixed it.

--
   Chris F.A. Johnson, webmaster 
   = Do not reply to the From: address; use Reply-To: 
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)




Re: Completion crashes the shell

2009-03-02 Thread Richard Leeden


Chris F.A. Johnson-3 wrote:
> 
> 
>  This completion function worked in previous versions, but fails in
>  bash4.0 when I press TAB:
> 
> _cpsh() {
>  COMPREPLY=( `
>  cd "$HOME/scripts" || return 3
>  printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
>  )
>  COMPREPLY=( "${comprep...@]%-sh}" )
>}
> complete -F _cpsh cpsh
> 
> 
>   This is what happens:
> 
> $ cpsh 
> malloc: ./parse.y:5563: assertion botched
> free: called with unallocated block argument
> last command: _cpsh() {
>COMPREPLY=( `
>cd "$HOME/scripts" || return 3
>printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
>)
>COMPREPLY=( "${comprep...@]%-sh}" )
> }
> Aborting...Aborted
> 

Have you applied the tab completion patch that Chet provided here: 
 http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00153.html 
http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00153.html 
-- 
View this message in context: 
http://www.nabble.com/Completion-crashes-the-shell-tp22294334p22294834.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





Completion crashes the shell

2009-03-02 Thread Chris F.A. Johnson


This completion function worked in previous versions, but fails in
bash4.0 when I press TAB:

_cpsh() {
COMPREPLY=( `
cd "$HOME/scripts" || return 3
printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
)
COMPREPLY=( "${comprep...@]%-sh}" )
  }
complete -F _cpsh cpsh


 This is what happens:

$ cpsh 
malloc: ./parse.y:5563: assertion botched
free: called with unallocated block argument
last command: _cpsh() {
  COMPREPLY=( `
  cd "$HOME/scripts" || return 3
  printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
  )
  COMPREPLY=( "${comprep...@]%-sh}" )
}
Aborting...Aborted

--
   Chris F.A. Johnson, webmaster 
   ===
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)