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

Re: zsh-3.0.2 repacked



> I'm sorry, but definitely there's no such alleged bug in the NeXTStep libc.
> Setting BAUD to zero fixes the jumping movement of the cursor, nothing else,
> the screen output is as fast/slow as without setting BAUD.
> 
> Then, after:
> 
>         setvbuf(shout, NULL, _IOFBF, 0);
> 
> shout->_bufsiz gives ZERO, as well as shout->_base still is ZERO, in other
> words, shout is unbuffered. I cannot imagine this should be different with
> other libc's. Have you actually checked this?
> 
> Also, to fix that all,
> 
>         setvbuf(shout, NULL, _IOFBF, BUFSIZ);
> 
> is totally sufficient, and has the advantage, that the buffer only is
> allocated if shout is actually used. (Further: imo there's really no need for
> conditional compilation here.).

This is definitely a bug.  If second argument is NULL, and the mode is
either _IOFBF (fully buffered) or _IOLBF (line buffered), then the libc
should ignore the fourth argument and allocate a buffer of the appropriate
length.  This is according to Steven's "Advanced Programming in the Unix
Environment".

rc



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