From owner-freebsd-current Wed Sep 1 6:53: 7 1999 Delivered-To: freebsd-current@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id 9A90E14DA5 for ; Wed, 1 Sep 1999 06:53:03 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id JAA05804 for current@freebsd.org; Wed, 1 Sep 1999 09:52:10 -0400 (EDT) (envelope-from luoqi) Date: Wed, 1 Sep 1999 09:52:10 -0400 (EDT) From: Luoqi Chen Message-Id: <199909011352.JAA05804@lor.watermarkgroup.com> To: current@freebsd.org Subject: new ncurses lib changed tgetstr() API Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG After the import of ncurses 5.0 (beta?), I noticed strange behavior of clear on my xterm. I tracked it down to an API change of tgetstr(), here is the new code: char *tgetstr(NCURSES_CONST char *id, char **area GCC_UNUSED) { int i; T((T_CALLED("tgetstr(%s,%p)"), id, area)); if (cur_term != 0) { TERMTYPE *tp = &(cur_term->type); for_each_string(i, tp) { const char *capname = ExtStrname(tp, i, strcodes); T(("trying %s", capname)); if (!strncmp(id, capname, 2)) { T(("found match : %s", _nc_visbuf(tp->Strings[i]))); /* setupterm forces cancelled strings to null */ returnPtr(tp->Strings[i]); } } } returnPtr(NULL); } and here is what termcap(3) says, char * tgetstr(const char *id, char **area) The tgetstr() function returns the string value of the capability id, places it in the buffer at area, and advances the area pointer. It decodes the abbreviations for this field described in termcap(5), except for cursor addressing and padding information. The tgetstr() function returns NULL if the capability was not found. The new code doesn't copy the cap string to the provided storage area, and programs like tset and tputs expect that. -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message