From: utzoo!decvax!harpo!npoiv!alice!rabbit!rtm
Newsgroups: net.bugs.4bsd
Title: RE: bug in tgetent()
Article-I.D.: rabbit.658
Posted: Thu Aug  5 07:42:00 1982
Received: Sun Aug  8 01:00:12 1982

----- News saved at Thu Aug  5 07:38:06 1982

tgetent() is a recursive function. Every time it sees
tc= it calls itself to find the description of the
specified terminal. If you set hopcount to zero each
time tgetent() is called, you defeat it's purpose,
which is to count the recursive calls to tgetent().
What you really want is to rename tgetent() _tgetent(),
and make a routine called tgetent() with the same arguments
as the old tgetent() (now _tgetent()) that sets hopcount = 0
and calls _tgetent() with its arguments.