Module Name:    src
Committed By:   riz
Date:           Wed Nov 14 20:25:31 UTC 2012

Modified Files:
        src/usr.bin/tput [netbsd-4]: tput.c

Log Message:
usr.bin/tput/tput.c                             patch

        Fix tput support for setaf terminfo sequence. PR#39883.
        [jnemeth, ticket #1468]


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.6.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.17 src/usr.bin/tput/tput.c:1.17.6.1
--- src/usr.bin/tput/tput.c:1.17	Sat Jul 30 14:43:13 2005
+++ src/usr.bin/tput/tput.c	Wed Nov 14 20:25:31 2012
@@ -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
@@ -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.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>
@@ -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);

Reply via email to