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

Re: added space bug fix



> This fixes the extremely annoying bug in zsh 3.1.2 that spaces get
> repeatedly added at the end of the line during menucompletion.  It
> does it by null-terminating the line when the space is deleted (the
> logic is set up so that the space is added in case it isn't menu
> completion then deleted again when it turns out it is).
> 
> It's possible the line should be null-terminated in zle_refresh.c
> instead/also, or that some other code should pay more attention to the
> line length variable ll, but I don't dare touch any of that.

No, your patch is absolutely correct and does the Right Thing.  It was me
who introduced this bug.  Shiftchars used to copy line[ll] but I changed
it because a memory debugger tool noticed that it is reading
uninitialised memory (although that was not a real bug in that case).
When shiftchars is called from zle_tricky.c, the line should be null
terminated.  For some reason this change did not go to the ChangeLog,
although it is entered in the zle_utils.c RCS log (ChangeLog is
automatically generated from the RCS logs).  I was quite puzzled looking
at the ChangeLog and not seeing anything which can cause this bug.

Thanks,

Zoltan



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