zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: duvall@dhduvall.student.Princeton.EDU (Danek Duvall)
Cc: zsh-workers@math.gatech.edu
Subject: Re: Breakage with compctl?
Date: Sat, 11 Jan 1997 23:51:49 +0100 (MET)	[thread overview]
Message-ID: <199701112251.XAA02453@hzoli.ppp.cs.elte.hu> (raw)
In-Reply-To: <199701110304.WAA05421@lorien.princeton.edu> from Danek Duvall at "Jan 10, 97 10:04:37 pm"

> 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@lorien.princeton.edu _
> 
> 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;
      }
  


      reply	other threads:[~1997-01-11 22:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-11  3:04 Danek Duvall
1997-01-11 22:51 ` Zoltan Hidvegi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199701112251.XAA02453@hzoli.ppp.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=duvall@dhduvall.student.Princeton.EDU \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).