Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Breakage with compctl?



> Run zsh -f and source a file containing the following:
> 
>     friends=( duvall )
> 
>     _machines=( lorien.princeton.edu cassius.mts.jhu.edu )
> 
>     function _get_hosts {
>       typeset -l _user
>       reply=()
>       read -l
>       _user=($=REPLY)
>       reply=($_machines)
>     }
> 
>     compctl -q -k friends -S @ -x 'n[0,@]' -K _get_hosts -- finger talk ytalk
> 
> Now type:
> 
>     % finger duvall@lo<TAB>
> 
> Which expands to
> 
>     % finger duvall@xxxxxxxxxxxxxxxxxxxx _
> 
> Now erase back to the @:
> 
>     % finger duvall@_
> 
> and expand:
> 
>     % <lots of garbage>

The fix is below.  read -l was buggy.

Zoltan


*** Src/builtin.c	1997/01/11 00:45:31	3.1.1.14
--- Src/builtin.c	1997/01/11 22:22:50
***************
*** 2785,2791 ****
  	    putchar('\n');
  	}
  	if (!ops['e'])
! 	    setsparam(reply, (char *) line);
  	return 0;
      }
  
--- 2785,2791 ----
  	    putchar('\n');
  	}
  	if (!ops['e'])
! 	    setsparam(reply, ztrdup((char *) line));
  	return 0;
      }
  



Messages sorted by: Reverse Date, Date, Thread, Author