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

Re: Repeatable crash in latest zsh



Bart Schaefer wrote:

> This has been happening for about a week, I think, so it isn't something
> from the most recent patches, but it still happens even with everything
> posted so far.  This input:
> 
> zsh% setopt completeinword
> zsh% ZSH=<C-b><TAB>
> 
> (that is, expand-or-complete before the '=') causes `zsh -f` to crash.

The code was to eager to restrict the things to `the string after the
equal sign', forgetting to test if it was after it.

Bye
 Sven

--- os/Zle/zle_tricky.c	Wed Mar 10 10:49:47 1999
+++ Src/Zle/zle_tricky.c	Wed Mar 10 17:49:18 1999
@@ -1278,7 +1278,7 @@
 	    *s = sav;
 	    if (skipparens(Inbrack, Outbrack, &s) > 0 || s > tt + cs - wb)
 		s = NULL, inwhat = IN_MATH, insubscr = 1;
-	    else if (*s == '=') {
+	    else if (*s == '=' && cs > wb + (s - tt)) {
 		s++;
 		wb += s - tt;
 		t0 = STRING;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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