xcurses2 tgetent crashes

Issue #110 resolved
Garrett D'Amore repo owner created an issue

The tgetent code in xcurses2 (and probably also xcurses, but I'm less worried about that) crashes, unless the caller has first done setupterm().

The problem is that the implementation of tgetent() attempts to dereference cur_term. That won't work until after setupterm is done. This breaks compatibility with old termcap.

I'm not worried about xcurses1, because anyone trying to use xcurses1 termcap compatibility was probably broken by default anyway. But we want to make xcurses2 the "default" for both termcap and curses, and that means we need to fix this bug.

A simple solution is to just implement tgetent() in terms of setupterm(), which is what the non-XPG version of libcurses does.

Comments (1)

  1. Log in to comment