Module Name: src Committed By: riz Date: Tue Nov 27 18:17:08 UTC 2012
Modified Files: src/usr.bin/tput [netbsd-5]: tput.c Log Message: usr.bin/tput/tput.c patch Fix tput support for setaf terminfo sequence. PR#39883. [jnemeth, ticket #1822] To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.19.4.1 src/usr.bin/tput/tput.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/tput/tput.c diff -u src/usr.bin/tput/tput.c:1.19 src/usr.bin/tput/tput.c:1.19.4.1 --- src/usr.bin/tput/tput.c:1.19 Mon Jul 21 14:19:27 2008 +++ src/usr.bin/tput/tput.c Tue Nov 27 18:17:08 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: tput.c,v 1.19 2008/07/21 14:19:27 lukem Exp $ */ +/* $NetBSD: tput.c,v 1.19.4.1 2012/11/27 18:17:08 riz Exp $ */ /*- * Copyright (c) 1980, 1988, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)tput.c 8.3 (Berkeley) 4/28/95"; #endif -__RCSID("$NetBSD: tput.c,v 1.19 2008/07/21 14:19:27 lukem Exp $"); +__RCSID("$NetBSD: tput.c,v 1.19.4.1 2012/11/27 18:17:08 riz Exp $"); #endif /* not lint */ #include <termios.h> @@ -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);