From jhein@timing.com  Mon Jan 28 16:10:17 2002
Return-Path: <jhein@timing.com>
Received: from Daffy.timing.com (daffy.timing.com [206.168.13.218])
	by hub.freebsd.org (Postfix) with ESMTP id 6FE9137B430
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Jan 2002 16:10:12 -0800 (PST)
Received: from Elmer.timing.com (elmer.timing.com [206.168.13.187])
	by Daffy.timing.com (8.11.3/8.11.3) with ESMTP id g0T0ABS71553;
	Mon, 28 Jan 2002 17:10:11 -0700 (MST)
	(envelope-from jhein@timing.com)
Received: (from jhein@localhost)
	by Elmer.timing.com (8.11.6/8.11.6) id g0T0ABO10630;
	Mon, 28 Jan 2002 17:10:11 -0700 (MST)
	(envelope-from jhein)
Message-Id: <200201290010.g0T0ABO10630@Elmer.timing.com>
Date: Mon, 28 Jan 2002 17:10:11 -0700 (MST)
From: "John E. Hein" <jhein@timing.com>
Reply-To: "John E. Hein" <jhein@timing.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: tgetent returns wrong value in libtermcap
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34394
>Category:       bin
>Synopsis:       tgetent returns wrong value in libtermcap
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 28 16:20:01 PST 2002
>Closed-Date:    Sat Apr 28 15:12:46 GMT 2007
>Last-Modified:  Sat Apr 28 15:12:46 GMT 2007
>Originator:     John E. Hein
>Release:        FreeBSD 4.5-PRERELEASE i386
>Organization:
Timing Solutions Corporation
>Environment:
System: FreeBSD Elmer.timing.com 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #0: Mon Dec 31 11:40:14 MST 2001 imp@hammer.village.org:/dell/imp/FreeBSD/src/sys/compile/ELMER i386


>Description:
	tgetent() should return 0 if it can't find a TERM entry.  It
    returns -1 which is indistuinguishable from "can't open /etc/termcap"
    (which *should* be a return value of -1).

>How-To-Repeat:
	
    env TERM=nonexistent_entry /bin/csh

>Fix:

    _nc_read_termcap_entry() in lib/libncurses/termcap.c returns -1
    and grab_entry() in contrib/ncurses/ncurses/tinfo/lib_setup.c
    assumes this means that the term database is inaccessible (line
    332 of RELENG_4_5).  It dutifully passes this up the chain to
    tgetent which returns the wrong value.  I think the fix should
    be made to lib/libncurses/termcap.c to return a better value from
    _nc_read_termcap_entry(), but I'm not sure all the ramifications
    (i.e., how it affects other callers of that function).
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Thu Jan 31 06:52:34 PST 2002 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=34394 

From: Gert-Jan Vons <vons@netcourrier.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/34394: tgetent returns wrong value in libtermcap
Date: Tue, 31 Dec 2002 14:25:09 +0100

 It seems this bug is still present in FreeBSD 4.7-RELEASE which I installed 
 yesterday.
 
 Additionally, the setupterm() function has the same problem; a call like 
 setupterm("nonexisting_tty", 1, &retcode) sets retcode to -1 instead of 0
 
 
 I saw that FBSD4.7R comes with ncurses 5.1, so I downloaded and tried the 
 latest version 5.3, and both tgetent() and setupterm() now seem to return 
 the correct values when the terminal is not found in the database.
 
 So merging the latest ncurses version into the source tree should fix this 
 problem...
 
 Regards,
 
 	Gert-Jan
 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Sat Apr 28 15:11:36 UTC 2007 
State-Changed-Why:  
We now have ncurses 5.6 in both 6.x and 7.x 


Responsible-Changed-From-To: peter->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Sat Apr 28 15:11:36 UTC 2007 
Responsible-Changed-Why:  
ncurses is my baby now. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34394 
>Unformatted:
