Module Name: src Committed By: tnn Date: Tue Oct 20 16:17:07 UTC 2009
Modified Files: src/dist/nvi/cl: cl_main.c Log Message: 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.2 -r1.3 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.2 src/dist/nvi/cl/cl_main.c:1.3 --- src/dist/nvi/cl/cl_main.c:1.2 Fri Dec 5 22:51:42 2008 +++ src/dist/nvi/cl/cl_main.c Tue Oct 20 16:17:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cl_main.c,v 1.2 2008/12/05 22:51:42 christos Exp $ */ +/* $NetBSD: cl_main.c,v 1.3 2009/10/20 16:17:07 tnn Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -98,8 +98,12 @@ * 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. */