tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: text layout in sysinst



On Sun, Feb 07, 2021 at 14:26:47 +0100, Roland Illig wrote:

> On 07.02.2021 05:25, Valery Ushakov wrote:
> > What's wrong is that for addstr we call _cursesi_addwchar with a
> > pointer to a dummy variable, but for addch we call it with a pointer
> > to win->curx, so we first increment win->curx in the nested
> > _cursesi_addwchar calls (for the spaces) and then we also increment it
> > in the top-level _cursesi_addwchar in that loop.
> 
> Thanks for this explanation, it seemed to provide all the details I
> needed to fix it myself.  I tried it but failed miserably since I
> stumpled upon a dozen other bugs while trying to fix this one.
> Therefore I first made the libcurses test framework a little more reliable.
> 
> Could you perhaps fix this one?  You know the code way better than I do,
> with all the subtleties around aliasing and SYNCH_IN and SYNCH_OUT and
> the various code paths that are taken by all the functions.

The change that introduced this problem was, I guess, trying to fix
the other side of the real bug.  Before that change, I guess, addch
was advancing curx, but addstr was not:

  http://mail-index.netbsd.org/source-changes/2016/11/28/msg079394.html

Fixing this properly requires more effort than I currently can afford
to spare (I don't really know the curses code that well, I just did a
few cleanups here and there).  Cc'ing Brett.


-uwe


Home | Main Index | Thread Index | Old Index