Skip to content

Commit

Permalink
usr.bin/tput/tput.c patch
Browse files Browse the repository at this point in the history
	Fix tput support for setaf terminfo sequence. PR#39883.
	[jnemeth, ticket #1468]
  • Loading branch information
riz committed Nov 14, 2012
1 parent 85ceb36 commit b84d0f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions usr.bin/tput/tput.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: tput.c,v 1.17 2005/07/30 14:43:13 christos Exp $ */
/* $NetBSD: tput.c,v 1.17.6.1 2012/11/14 20:25:31 riz Exp $ */

/*-
* Copyright (c) 1980, 1988, 1993
Expand Down Expand Up @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1988, 1993\n\
#if 0
static char sccsid[] = "@(#)tput.c 8.3 (Berkeley) 4/28/95";
#endif
__RCSID("$NetBSD: tput.c,v 1.17 2005/07/30 14:43:13 christos Exp $");
__RCSID("$NetBSD: tput.c,v 1.17.6.1 2012/11/14 20:25:31 riz Exp $");
#endif /* not lint */

#include <termios.h>
Expand Down Expand Up @@ -105,7 +105,10 @@ main(int argc, char **argv)
break;
}
cptr = buf;
if (tgetstr(p, &cptr))
if (strlen(p) > 2)
errx(2, "this program only supports termcap "
"capabilities, not terminfo");
else if (tgetstr(p, &cptr))
argv = process(p, buf, argv);
else if ((n = tgetnum(p)) != -1)
(void)printf("%d\n", n);
Expand Down

0 comments on commit b84d0f3

Please sign in to comment.