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

Re: zsh 5.3.1 crashes on completion



On Wed, 17 May 2017 11:18:36 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 16, 12:05pm, Peter Stephenson wrote:
> }
> }      cmdsp = hs->csp;
> } +    unlinkcurline();
> } +    curline_linked = hs->curline_linked;
> } +    if (curline_linked)
> } +	linkcurline();
> }  }
> 
> Shouldn't that be
> 
>     unlinkcurline();
>     if (hs->curline_linked)
>         linkcurline();

It doesn't actually make a difference since linkcurline() doesn't check
the current status, but it's probably more logical that way, in case
someone adds extra checking.

> ??  unlinkcurline() will set curline_linked = 0 and linkcurline() will
> set it back to 1 again?  Don't set curline_linked before linking it?
> 
> } +    DPUTS(chline != NULL, "chline set at start of history");
> 
> Actual error is that chline NOT set at start?

No, chline shouldn't be set here.  If it is, that means we haven't saved
the previous status on the stack, which woulc clear chline, and if we
haven't done that, mayhem may result.  The sense of DPUTS() is confusingly
opposite to assert().

pws



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