bug-ncurses
[Top][All Lists]
Advanced

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

Re: derwin problems


From: Roger Gammans
Subject: Re: derwin problems
Date: Sat, 11 May 2002 20:03:15 +0100
User-agent: Mutt/1.2.5i

On Fri, May 10, 2002 at 10:04:19PM -0700, Scott Beck wrote:
> 
> Compile with:
>     gcc -g -o curses curses.c -lncurses -DUSE_DER=1
> 
> to see it segv, without -DUSE_DER it works fine (atleast on my system it 
> does).

If I apply the attached patch to libncurses it seems 
to fix it. But this isn't the complete fix IHMO.

Rationale: When a standard (nor sub/der) window is resized realloc
is called on the line buffers. Realloc may move these block.

Later when wresize is called in a derived window, if the 
line buffer has been realloced then it wasn't moved in the
copy of the pointer in the derwin. The pacth forces all
the line buffer pointers to be updated on wresize.

Unfortunaltley this means if you call wresize on a window, you
must call it on all it's sub-windows. A better fix would be
to update the copied pointer in the subwindows when their parent
is resized.

TTFN
-- 
Roger.
Master of Peng Shui.  (Ancient oriental art of Penguin Arranging)

Attachment: resize.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]