Module Name: src Committed By: riz Date: Thu Feb 23 22:27:29 UTC 2012
Modified Files: src/dist/nvi/cl [netbsd-5]: cl_main.c Log Message: Pull up following revision(s) (requested by spz in ticket #1723): dist/nvi/cl/cl_main.c: revision 1.3 Print a warning if TERM is not set and stdin is a tty. PR bin/42144. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2.6.1 -r1.1.1.2.6.2 src/dist/nvi/cl/cl_main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/dist/nvi/cl/cl_main.c diff -u src/dist/nvi/cl/cl_main.c:1.1.1.2.6.1 src/dist/nvi/cl/cl_main.c:1.1.1.2.6.2 --- src/dist/nvi/cl/cl_main.c:1.1.1.2.6.1 Tue Jan 20 02:41:11 2009 +++ src/dist/nvi/cl/cl_main.c Thu Feb 23 22:27:29 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cl_main.c,v 1.1.1.2.6.1 2009/01/20 02:41:11 snj Exp $ */ +/* $NetBSD: cl_main.c,v 1.1.1.2.6.2 2012/02/23 22:27:29 riz Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -98,8 +98,12 @@ main(int argc, char **argv) * We have to know what terminal it is from the start, since we may * have to use termcap/terminfo to find out how big the screen is. */ - if ((ttype = getenv("TERM")) == NULL) + if ((ttype = getenv("TERM")) == NULL) { + if (isatty(STDIN_FILENO)) + fprintf(stderr, "%s: warning: TERM is not set\n", + gp->progname); ttype = "unknown"; + } term_init(gp->progname, ttype); /* Add the terminal type to the global structure. */