From: Thomas E. Dickey Date: Sat, 22 Jun 2013 23:39:25 +0000 (+0000) Subject: ncurses 5.9 - patch 20130622 X-Git-Tag: v6.0~99 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=d3aaa2f7ce1fec732af0f6c0396719cbc846ac18 ncurses 5.9 - patch 20130622 + modify the clear program to take into account the E3 extended capability to clear the terminal's scrollback buffer (patch by Miroslav Lichvar, Redhat #815790). + clarify in resizeterm manpage that LINES and COLS are updated. + updated ansi example in terminfo.tail, correct misordered example of sgr. + fix other doclifter warnings for manpages + remove unnecessary ".ta" in terminfo.tail, add missing ".fi" (patch by Eric Raymond). --- diff --git a/NEWS b/NEWS index 93d1e873..53f7763b 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2072 2013/06/15 21:16:04 tom Exp $ +-- $Id: NEWS,v 1.2075 2013/06/22 22:23:47 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,17 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20130622 + + modify the clear program to take into account the E3 extended + capability to clear the terminal's scrollback buffer (patch by + Miroslav Lichvar, Redhat #815790). + + clarify in resizeterm manpage that LINES and COLS are updated. + + updated ansi example in terminfo.tail, correct misordered example + of sgr. + + fix other doclifter warnings for manpages + + remove unnecessary ".ta" in terminfo.tail, add missing ".fi" + (patch by Eric Raymond). + 20130615 + minor changes to some configure macros to make them more reusable. + fixes for tabs program (prompted by report by Nick Andrik): diff --git a/dist.mk b/dist.mk index f38a92c6..41daac3e 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.933 2013/06/15 21:17:44 tom Exp $ +# $Id: dist.mk,v 1.934 2013/06/22 14:41:51 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 NCURSES_MINOR = 9 -NCURSES_PATCH = 20130615 +NCURSES_PATCH = 20130622 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/frm_driver.c b/form/frm_driver.c index 0a39d322..9131edf5 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.103 2013/03/09 22:48:47 tom Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.104 2013/06/22 20:02:55 tom Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -4534,7 +4534,7 @@ field_buffer(const FIELD *field, int buffer) init_mb(state); next = _nc_wcrtomb(0, data[n].chars[0], &state); - if (!isEILSEQ(next)) + if (next > 0) need += next; } } diff --git a/man/clear.1 b/man/clear.1 index b70d37e8..d8e24e5b 100644 --- a/man/clear.1 +++ b/man/clear.1 @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: clear.1,v 1.8 2010/12/04 18:36:44 tom Exp $ +.\" $Id: clear.1,v 1.10 2013/06/22 22:22:11 tom Exp $ .TH @CLEAR@ 1 "" .ds n 5 .SH NAME @@ -35,9 +35,10 @@ \fB@CLEAR@\fR .br .SH DESCRIPTION -\fB@CLEAR@\fR clears your screen if this is possible. It looks in the -environment for the terminal type and then in the \fBterminfo\fR database to -figure out how to clear the screen. +\fB@CLEAR@\fR clears your screen if this is possible, +including its scrollback buffer (if the extended "E3" capability is defined). +\fB@CLEAR@\fR looks in the environment for the terminal type and then in the +\fBterminfo\fR database to determine how to clear the screen. .PP \fB@CLEAR@\fR ignores any command-line parameters that may be present. .SH SEE ALSO diff --git a/man/curs_mouse.3x b/man/curs_mouse.3x index 01dc6829..1de85e51 100644 --- a/man/curs_mouse.3x +++ b/man/curs_mouse.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2010,2013 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_mouse.3x,v 1.38 2010/12/04 18:38:55 tom Exp $ +.\" $Id: curs_mouse.3x,v 1.39 2013/06/22 18:09:42 tom Exp $ .TH curs_mouse 3X "" .na .hy 0 @@ -40,20 +40,18 @@ .ad .hy .SH SYNOPSIS -.nf -\fB#include +\fB#include \fR .PP -\fBtypedef unsigned long mmask_t; +\fBtypedef unsigned long mmask_t;\fR .PP -typedef struct -{ - short id; \fI/* ID to distinguish multiple devices */\fB - int x, y, z; \fI/* event coordinates */\fB - mmask_t bstate; \fI/* button state bits */\fB -} -MEVENT;\fR +.nf +\fBtypedef struct {\fR +\fB short id; \fR\fI/* ID to distinguish multiple devices */\fR +\fB int x, y, z; \fR\fI/* event coordinates */\fR +\fB mmask_t bstate; \fR\fI/* button state bits */\fR +\fB} MEVENT;\fR .fi -.br +.PP \fBbool has_mouse(void);\fR .br \fBint getmouse(MEVENT *event);\fR diff --git a/man/curs_sp_funcs.3x b/man/curs_sp_funcs.3x index 020e5c11..c7c55ddb 100644 --- a/man/curs_sp_funcs.3x +++ b/man/curs_sp_funcs.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2010 Free Software Foundation, Inc. * +.\" Copyright (c) 2010,2013 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_sp_funcs.3x,v 1.5 2010/12/04 18:38:55 tom Exp $ +.\" $Id: curs_sp_funcs.3x,v 1.6 2013/06/22 17:53:59 tom Exp $ .TH curs_sp_funcs 3X "" .na .hy 0 @@ -186,7 +186,7 @@ new_prescr \- \fBcurses\fR screen-pointer extension .br \fBint slk_attrset_sp(SCREEN*, const chtype);\fR .br -\fBint slk_attr_sp((SCREEN*);\fR +\fBint slk_attr_sp(SCREEN*);\fR .br \fBint slk_clear_sp(SCREEN*);\fR .br diff --git a/man/curs_variables.3x b/man/curs_variables.3x index 8cfee529..952ececa 100644 --- a/man/curs_variables.3x +++ b/man/curs_variables.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2010 Free Software Foundation, Inc. * +.\" Copyright (c) 2010,2013 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_variables.3x,v 1.4 2010/12/04 18:38:55 tom Exp $ +.\" $Id: curs_variables.3x,v 1.5 2013/06/22 20:39:35 tom Exp $ .TH curs_variables 3X "" .de bP .IP \(bu 4 @@ -74,7 +74,7 @@ This page summarizes variables provided by the \fBcurses\fP library. A more complete description is given in the \fBcurses\fP(3X) manual page. .PP Depending on the configuration, these may be actual variables, -or macros (see \fBcurs_threads\fR(3X)) +or macros (see \fBcurs_threads\fR(3X) and \fBcurs_opaque\fR(3X)) which provide read-only access to \fIcurses\fP's state. In either case, applications should treat them as read-only to avoid confusing the library. @@ -129,6 +129,7 @@ ESCDELAY and TABSIZE are extensions, not provided in most other implementations of curses. .SH SEE ALSO \fBcurses\fR(3X), +\fBcurs_opaque\fR(3X), \fBcurs_threads\fR(3X), \fBterm_variables\fR(3X), \fBterminfo\fR(3X), diff --git a/man/form_variables.3x b/man/form_variables.3x index 49f28762..f4af349b 100644 --- a/man/form_variables.3x +++ b/man/form_variables.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2010 Free Software Foundation, Inc. * +.\" Copyright (c) 2010,2013 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: form_variables.3x,v 1.3 2010/12/04 18:38:55 tom Exp $ +.\" $Id: form_variables.3x,v 1.4 2013/06/22 17:58:32 tom Exp $ .TH form_variables 3X "" .ds n 5 .na @@ -45,7 +45,6 @@ .SH SYNOPSIS .nf \fB#include \fR -.br .PP \fBFIELDTYPE * TYPE_ALNUM;\fR \fBFIELDTYPE * TYPE_ALPHA;\fR @@ -54,7 +53,6 @@ \fBFIELDTYPE * TYPE_IPV4;\fR \fBFIELDTYPE * TYPE_NUMERIC;\fR \fBFIELDTYPE * TYPE_REGEXP;\fR -.br .fi .SH DESCRIPTION These are building blocks for the form library, diff --git a/man/resizeterm.3x b/man/resizeterm.3x index f8715d35..25a760c7 100644 --- a/man/resizeterm.3x +++ b/man/resizeterm.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -26,9 +26,9 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" Author: Thomas E. Dickey 1996-2005 +.\" Author: Thomas E. Dickey 1996-on .\" -.\" $Id: resizeterm.3x,v 1.15 2012/07/07 18:38:21 tom Exp $ +.\" $Id: resizeterm.3x,v 1.17 2013/06/22 20:41:54 tom Exp $ .TH resizeterm 3X "" .SH NAME \fBis_term_resized\fR, @@ -48,7 +48,8 @@ It provides callers with a hook into the \fBncurses\fR data to resize windows, primarily for use by programs running in an X Window terminal (e.g., xterm). The function \fBresizeterm\fR resizes the standard and current windows to the specified dimensions, and adjusts other bookkeeping data used by -the \fBncurses\fR library that record the window dimensions. +the \fBncurses\fR library that record the window dimensions +such as the \fBLINES\fP and \fBCOLS\fP variables. .LP Most of the work is done by the inner function \fBresize_term\fR. The outer function \fBresizeterm\fR adds bookkeeping for the SIGWINCH handler. @@ -64,7 +65,7 @@ A support function \fBis_term_resized\fR is provided so that applications can check if the \fBresize_term\fR function would modify the window structures. It returns TRUE if the windows would be modified, and FALSE otherwise. .SH RETURN VALUE -Except as notes, these function return +Except as noted, these functions return the integer \fBERR\fR upon failure and \fBOK\fR on success. They will fail if either of the dimensions are less than or equal to zero, or if an error occurs while (re)allocating memory for the windows. @@ -75,7 +76,7 @@ context where \fBmalloc\fR or \fBrealloc\fR may have been interrupted, since it uses those functions. .PP If ncurses is configured to supply its own SIGWINCH handler, -the \fBresizeterm\fR function ungetch's a \fBKEY_RESIZE\fR which +the \fBresizeterm\fR function \fBungetch\fP's a \fBKEY_RESIZE\fR which will be read on the next call to \fBgetch\fR. This is used to alert an application that the screen size has changed, and that it should repaint special features such as pads that cannot @@ -87,6 +88,7 @@ the operating system. Thus, even if a SIGWINCH is received, no screen size change may be recorded. .SH SEE ALSO +\fBcurs_getch\fR(3X), \fBcurs_variables\fR(3X), \fBwresize\fR(3X). .SH AUTHOR diff --git a/man/tabs.1 b/man/tabs.1 index 77323492..f6b797d7 100644 --- a/man/tabs.1 +++ b/man/tabs.1 @@ -26,14 +26,13 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: tabs.1,v 1.10 2013/06/11 00:56:40 tom Exp $ +.\" $Id: tabs.1,v 1.11 2013/06/22 18:11:57 tom Exp $ .TH @TABS@ 1 "" .ds n 5 .SH NAME \fB@TABS@\fR \- set tabs on a terminal .SH SYNOPSIS \fB@TABS@\fR [\fIoptions\fR]] \fI[tabstop-list]\fR -.br .SH DESCRIPTION .PP The \fB@TABS@\fP program clears and sets tab-stops on the terminal. diff --git a/man/terminfo.tail b/man/terminfo.tail index 58d6857a..477c06b1 100644 --- a/man/terminfo.tail +++ b/man/terminfo.tail @@ -1,4 +1,4 @@ -.\" $Id: terminfo.tail,v 1.61 2013/03/03 00:06:39 tom Exp $ +.\" $Id: terminfo.tail,v 1.65 2013/06/22 19:00:26 tom Exp $ .\" Beginning of terminfo.tail file .\" This file is part of ncurses. .\" See "terminfo.head" for copyright. @@ -53,30 +53,37 @@ The following entry, describing an ANSI-standard terminal, is representative of what a \fBterminfo\fR entry for a modern terminal typically looks like. .PP .nf -.in -2 -.ta .3i .ft CW \s-2ansi|ansi/pc-term compatible with color, - mc5i, - colors#8, ncv#3, pairs#64, - cub=\\E[%p1%dD, cud=\\E[%p1%dB, cuf=\\E[%p1%dC, - cuu=\\E[%p1%dA, dch=\\E[%p1%dP, dl=\\E[%p1%dM, - ech=\\E[%p1%dX, el1=\\E[1K, hpa=\\E[%p1%dG, ht=\\E[I, - ich=\\E[%p1%d@, il=\\E[%p1%dL, indn=\\E[%p1%dS, .indn=\\E[%p1%dT, - kbs=^H, kcbt=\\E[Z, kcub1=\\E[D, kcud1=\\E[B, - kcuf1=\\E[C, kcuu1=\\E[A, kf1=\\E[M, kf10=\\E[V, - kf11=\\E[W, kf12=\\E[X, kf2=\\E[N, kf3=\\E[O, kf4=\\E[P, - kf5=\\E[Q, kf6=\\E[R, kf7=\\E[S, kf8=\\E[T, kf9=\\E[U, - kich1=\\E[L, mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, - op=\\E[37;40m, rep=%p1%c\\E[%p2%{1}%\-%db, - rin=\\E[%p1%dT, s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, - s3ds=\\E+B, setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm, - setb=\\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - setf=\\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m, - sgr=\\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m, - sgr0=\\E[0;10m, tbc=\\E[2g, u6=\\E[%d;%dR, u7=\\E[6n, - u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%p1%dd,\s+2 -.in +2 + am, mc5i, mir, msgr, + colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64, + acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260 + j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303 + u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376, + bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J, + cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B, + cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH, + cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P, + dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K, + el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH, + ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J, + indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D, + kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L, + mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m, + rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT, + rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m, + s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B, + setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm, + sgr=\\E[0;10%?%p1%t;7%; + %?%p2%t;4%; + %?%p3%t;7%; + %?%p4%t;5%; + %?%p6%t;1%; + %?%p7%t;8%; + %?%p9%t;11%;m, + sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m, + smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n, + u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd, .fi .ft R .PP @@ -350,6 +357,7 @@ Thus the model 33 teletype is described as bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1 .\".in +2 .ft R +.fi .PP while the Lear Siegler \s-1ADM-3\s0 is described as .PP @@ -866,6 +874,7 @@ either standout or reverse modes are turned on. .PP Writing out the above sequences, along with their dependencies yields .PP +.ne 11 .TS center; l l l @@ -873,6 +882,7 @@ l l l lw18 lw14 lw18. \fBsequence when to output terminfo translation\fP +.ft CW \\E[0 always \\E[0 ;1 if p1 or p6 %?%p1%p6%|%t;1%; ;4 if p2 %?%p2%|%t;4%; @@ -881,14 +891,17 @@ lw18 lw14 lw18. ;8 if p7 %?%p7%|%t;8%; m always m ^N or ^O if p9 ^N, else ^O %?%p9%t^N%e^O%; +.ft R .TE .PP Putting this all together into the sgr sequence gives: .PP +.ft CW .nf - sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%; - %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;, + sgr=\\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%; + %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\\016%e\\017%;, .fi +.ft R .PP Remember that if you specify sgr, you must also specify sgr0. Also, some implementations rely on sgr being given if sgr0 is, diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 21ee98d2..946342da 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.157 2013/06/06 01:01:18 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.158 2013/06/22 19:59:08 tom Exp $") /**************************************************************************** * @@ -687,7 +687,9 @@ TINFO_SETUP_TERM(TERMINAL ** tp, #endif } else { #ifdef USE_TERM_DRIVER - termp = (TERMINAL *) typeCalloc(TERMINAL_CONTROL_BLOCK, 1); + TERMINAL_CONTROL_BLOCK *my_tcb; + my_tcb = typeCalloc(TERMINAL_CONTROL_BLOCK, 1); + termp = &(my_tcb->term); #else termp = typeCalloc(TERMINAL, 1); #endif diff --git a/package/debian/changelog b/package/debian/changelog index 675d7dea..8b7e790e 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20130615) unstable; urgency=low +ncurses6 (5.9-20130622) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 15 Jun 2013 17:17:42 -0400 + -- Thomas E. Dickey Sat, 22 Jun 2013 11:56:32 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/ncurses.spec b/package/ncurses.spec index bf1f4dd8..a453f944 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Release: 5.9 -Version: 20130615 +Version: 20130622 License: X11 Group: Development/Libraries Source: ncurses-%{release}-%{version}.tgz diff --git a/progs/clear.c b/progs/clear.c index 9f5a5438..4ac503ed 100644 --- a/progs/clear.c +++ b/progs/clear.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2013 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #define USE_LIBTINFO #include -MODULE_ID("$Id: clear.c,v 1.11 2007/10/13 22:16:02 tom Exp $") +MODULE_ID("$Id: clear.c,v 1.13 2013/06/22 22:20:54 tom Exp $") static int putch(int c) @@ -52,7 +52,15 @@ main( int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { + char *E3; + setupterm((char *) 0, STDOUT_FILENO, (int *) 0); + + /* Clear the scrollback buffer if possible. */ + E3 = tigetstr("E3"); + if (E3) + (void) tputs(E3, lines > 0 ? lines : 1, putch); + ExitProgram((tputs(clear_screen, lines > 0 ? lines : 1, putch) == ERR) ? EXIT_FAILURE : EXIT_SUCCESS); diff --git a/test/worm.c b/test/worm.c index 19d16347..c3fc0da8 100644 --- a/test/worm.c +++ b/test/worm.c @@ -61,7 +61,7 @@ Options: traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.64 2013/04/27 19:50:17 tom Exp $ + $Id: worm.c,v 1.65 2013/06/22 20:01:41 tom Exp $ */ #include @@ -362,8 +362,7 @@ draw_all_worms(void) if (first) { first = FALSE; for (n = 0, w = &worm[0]; n < number; n++, w++) { - int rc; - rc = pthread_create(&(w->thread), NULL, start_worm, w); + (void) pthread_create(&(w->thread), NULL, start_worm, w); } } #else