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

Re: list-expand fix and a bug report



Mark Borges wrote:
> Do any of these patches for 10.1 (or 10+ for that matter) fix this:

No, bat there is a patch below for that.

> >> Mark Borges(mb) wrote on Mon, 17 Jul 95 14:50:50 MDT:
> mb> Are you seeing this?
> 
> mb> Somewhere between hzoli9 and hzoli10.1 <TAB> completion inside a for
> mb> control structure doesn't work. For example,
> 
> mb> $ ~/bin/sparc/zsh-2.6h9 -f
> mb> bjerknes% echo $ZSH_VERSION
> mb> 2.6-beta9
> mb> bjerknes% setopt autolist
> mb> bjerknes% for i in a*; do
> >> echo a<TAB>	# a tab correctly prints out the ambiguous files
> mb> a1  a2  a3
> 
> mb> but in hzoli10.1:
> 
> mb> $ ~/bin/sparc/zsh-2.6h10.1 -f
> mb> bjerknes% echo $ZSH_VERSION
> mb> 2.6-beta10-hzoli10.1
> mb> bjerknes% setopt autolist 
> mb> bjerknes% for i in a*; do
> 
> >> echo a<TAB>	# Huh? Another a keeps getting added, and no list is printed.
> 
> >> echo aa<TAB>
>       
> >> echo aaa<TAB>	# can go on indefinitely
>       
> >> echo aaaa
>       
> >> echo aaaaa
>       
> >> echo aaaaaa
>       
> mb> This also has patches from zefram (I forget what they do). I was just
> mb> curious if the bug has infected your copy as well.

In fact the bug appeared after Peter's input patches. The problem again is
that unlike the old history code, ingetch() doesn't remove tokens from the
input stream.  I is not necessarily a bug although I think this should be put
back in there (it's only one line) as tokens in iput can cause completely
unexpected results.  But for now it is good as it showed up two old bug so
far.  This particular bug is in zle_tricky.c.  If the current line is part of
a command structure, zle prepends chline to the current line before calling
the lexer.  But chline contains HISTSPACEs which should be replaced with
normal spaces.  Here is the one line patch for that.  It can be (and should
be) applied to any zsh release.

Bye,

  Zoltan

--- 1.30	1995/07/22 22:52:16
+++ Src/zle_tricky.c	1995/07/22 23:00:34
@@ -522,7 +522,7 @@
 		*q++ = '\\';
 		*q++ = '\\';
 	    }
-	    *q++ = *p;
+	    *q++ = *p == HISTSPACE ? ' ' : *p;
 	}
 	/* Put a zero byte after it and append the original line contents. */
 	*q = '\0';



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