From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13082 invoked by alias); 31 Aug 2010 19:13:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28219 Received: (qmail 12106 invoked from network); 31 Aug 2010 19:13:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at ntlworld.com designates 81.103.221.56 as permitted sender) Date: Tue, 31 Aug 2010 19:12:54 +0100 From: Peter Stephenson To: zsh workers Subject: Re: Crash in reverse-menu-complete with menu-selection Message-ID: <20100831191254.211b2ea5@pws-pc> In-Reply-To: References: <100824081606.ZM28228@torch.brasslantern.com> <100824094939.ZM28482@torch.brasslantern.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=3ENABmdyEd/Fm7fR7+mZIuMDn6+IErAeEhlfWBImZFk= c=1 sm=0 a=In0HJ4XZIDcA:10 a=DogomfpGjd0A:10 a=kj9zAlcOel0A:10 a=NLZqzBF-AAAA:8 a=l_32PpEDzbfjPYyu2xUA:9 a=S3cXqeNzRZVaLVYMn5IA:7 a=dALIu_DCkt3-5J8nxfa8rDW-82gA:4 a=CjuIK1q_8ugA:10 a=_dQi-Dcv4p4A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On Tue, 24 Aug 2010 19:38:21 +0200 > Hmm... this fixes it (ie, this specific case) but I have absolutely no > idea which of these functions expect the line to be metafied and > unmetafied, and who is doing it wrong. > > diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c > index bac072e..37ccc7b 100644 > --- a/Src/Zle/complist.c > +++ b/Src/Zle/complist.c > @@ -3217,7 +3217,9 @@ domenuselect(Hookdef dummy, Chdata dat) > !strcmp(cmd->nam, "reverse-menu-complete")) { > mode = 0; > comprecursive = 1; > + unmetafy_line(); > reversemenucomplete(zlenoargs); > + metafy_line(); > mselect = (*(minfo.cur))->gnum; > setwish = 1; Thanks. This looks right. The guts of completion have the line metafied because they deal with null-terminated strings from the main shell. The main entry point to reversemenucomplete() from Zle would have it unmetafied because Zle deals in indvidual characters / codepoints (the debug check happens further in when it hits domenucomplete()). The boundary between the two is incredibly tortuous. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/