Debian bug report logs - #1677 tgetent() returns unexpected error return codes Package: ncurses-developer, git ; Reported by: Bill Mitchell ; 17 days old. ----------------------------------------------------------------------- Message received at debian-bugs: From mdd.comm.mot.com!mitchell Sat Oct 14 10:44:32 1995 Return-Path: Received: from pixar.com by mongo.pixar.com with smtp (Smail3.1.28.1 #15) id m0t4AdL-000ETRC; Sat, 14 Oct 95 10:44 PDT Received: from motgate.mot.com by pixar.com with SMTP id AA04192 (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Sat, 14 Oct 1995 10:38:13 -0700 Received: from pobox.mot.com (pobox.mot.com [129.188.137.100]) by motgate.mot.com (8.6.11/8.6.10/MOT-3.8) with ESMTP id LAA18032 for ; Sat, 14 Oct 1995 11:09:06 -0500 Received: from mdd.comm.mot.com (mdisea.mdd.comm.mot.com [138.242.64.201]) by pobox.mot.com (8.6.11/8.6.10/MOT-3.8) with SMTP id LAA19116 for ; Sat, 14 Oct 1995 11:09:05 -0500 Received: from bb29c.mdd.comm.mot.com by mdd.comm.mot.com (4.1/SMI-4.1) id AA22957; Sat, 14 Oct 95 09:09:02 PDT Received: by bb29c.mdd.comm.mot.com (4.1/SMI-4.1) id AA03278; Sat, 14 Oct 95 09:09:00 PDT Date: Sat, 14 Oct 1995 09:08:59 -0700 (PDT) From: Bill Mitchell X-Sender: mitchell@bb29c To: debian-bugs@pixar.com Subject: tgetent() returns unexpected error return codes Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII PACKAGE: ncurses-developer, git VERSION: 1.9.4-0, 2.3.7-3 I'm not a curses programmer, but I maintain the git package, which uses libncurses. I see that the termcap(3ncurses) man page says: RETURN VALUE Routines that return an integer return ERR upon failure and OK (SVr4 only specifies "an integer value other than ERR") upon successful completion. However, I also see that the SunOS curses(3X) man page says: tgetent() extracts the entry for terminal name into the bp buffer, with the current size of the tty (usually a window). This allows pre-SunWindows programs to run in a window of arbitrary size. bp should be a character buffer of size 1024 and must be retained through all subsequent calls to tgetnum(), tgetflag(), and tgetstr(). tgetent() returns -1 if it cannot open the termcap() file, 0 if the terminal name given does not have an entry, and 1 if all goes well. It will look in the environment for a TERMCAP variable. If found, and the value does not begin with a slash, and the terminal type name is the same as the environment string TERM, the TERMCAP string is used instead of reading the termcap file. If it does begin with a slash, the string is used as a path name rather than /etc/termcap. This can speed up entry into programs that call tgetent, as well as to help debug new terminal descriptions or to make one for your terminal if you cannot write the file /etc/termcap. Note: if the window size changes, the ``lines'' and ``columns'' entries in bp are no longer correct. See the SunView 1 Programmer's Guide for details regarding [how to handle] this. and this SunOS-style (BSD?) behavior is what is expected by the git(1) code. This results in a misleading error message from git(1) if a terminal is specified which cannot be found in the database. I imagine that other software probably expects this behavior as well. Is there any chance of ncurses being enhanced to return SunOS-style return values, or should I modify the git package for compatability with the current, less informative, SVr4-style return values and submit the change to the git author? mitchell@mdd.comm.mot.com (Bill Mitchell) ----------------------------------------------------------------------- Acknowledgement sent to Bill Mitchell : New bug report received and forwarded. Full text available. ----------------------------------------------------------------------- Report forwarded to debian-devel@pixar.com : Bug#1677 ; Package ncurses-developer, git . Full text available. ----------------------------------------------------------------------- Ian Jackson / iwj10@thor.cam.ac.uk , with the debian-bugs tracking mechanism This page last modified 07:43:01 GMT Wed 01 Nov