zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <Peter.Stephenson@csr.com>
To: <zsh-workers@zsh.org>
Cc: <353863@bugs.debian.org>
Subject: Re: Bugreport: completion hanging at ubo<Tab> - endless loop
Date: Thu, 24 Feb 2011 12:38:47 +0000	[thread overview]
Message-ID: <20110224123847.1ec9a904@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20110223113004.6e99ffa9@pws-pc.ntlworld.com>

On Wed, 23 Feb 2011 11:30:04 +0000
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> On Wed, 23 Feb 2011 11:50:18 +0100
> Michael Prokop <news@michael-prokop.at> wrote:
> > in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=353863
> > Sebastien Desreux reported a bug about zsh with its
> > completion system in a specific situation.
> > 
> > To trigger the bug (at least 4.3.10 and 4.3.11 in Debian are
> > known to be affected by this bug):
> > 
> >   zsh -f
> >   autoload -Uz compinit; compinit; alias ubox=ls
> >   ubo<tab>
> > 
> > Then the zsh process is hanging in an endless loop, eating CPU.
> 
> I think the answer might be never to expand aliases when the "x" would
> be added to the command word.  That might be easier said than done.

Looks like this is my fault.  There's code to stop lexical processing
when we've got to the cursor position, which means the alias never gets
expanded, but when I upgraded the interface I missed the fact that it
was doing a test of lexflags against 1 and now needs to look for the bit
LEXFLAGS_ZLE.

Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.64
diff -p -u -r1.64 lex.c
--- Src/lex.c	21 Feb 2011 11:32:47 -0000	1.64
+++ Src/lex.c	24 Feb 2011 12:36:41 -0000
@@ -1825,7 +1825,7 @@ exalias(void)
 	    int zp = lexflags;
 
 	    gotword();
-	    if (zp == 1 && !lexflags) {
+	    if ((zp & LEXFLAGS_ZLE) && !lexflags) {
 		if (zshlextext == copy)
 		    zshlextext = tokstr;
 		return 0;

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


      parent reply	other threads:[~2011-02-24 13:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 10:50 Michael Prokop
2011-02-23 11:30 ` Peter Stephenson
2011-02-23 20:03   ` Bart Schaefer
2011-02-24 12:38   ` Peter Stephenson [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=20110224123847.1ec9a904@pwslap01u.europe.root.pri \
    --to=peter.stephenson@csr.com \
    --cc=353863@bugs.debian.org \
    --cc=zsh-workers@zsh.org \
    /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).