Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libterminfo Revert botched commit.
details: https://anonhg.NetBSD.org/src/rev/20e136c1223b
branches: trunk
changeset: 352255:20e136c1223b
user: roy <roy%NetBSD.org@localhost>
date: Thu Mar 23 00:36:37 2017 +0000
description:
Revert botched commit.
diffstat:
lib/libterminfo/setupterm.c | 40 ++--------------------------------------
lib/libterminfo/term.h | 6 +++---
2 files changed, 5 insertions(+), 41 deletions(-)
diffs (98 lines):
diff -r a448e2b3fbb8 -r 20e136c1223b lib/libterminfo/setupterm.c
--- a/lib/libterminfo/setupterm.c Thu Mar 23 00:23:29 2017 +0000
+++ b/lib/libterminfo/setupterm.c Thu Mar 23 00:36:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setupterm.c,v 1.5 2017/03/23 00:23:29 roy Exp $ */
+/* $NetBSD: setupterm.c,v 1.6 2017/03/23 00:36:37 roy Exp $ */
/*
* Copyright (c) 2009, 2011 The NetBSD Foundation, Inc.
@@ -28,12 +28,10 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: setupterm.c,v 1.5 2017/03/23 00:23:29 roy Exp $");
+__RCSID("$NetBSD: setupterm.c,v 1.6 2017/03/23 00:36:37 roy Exp $");
-#include <sys/ioctl.h>
#include <assert.h>
#include <err.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
@@ -41,20 +39,6 @@
#include <term_private.h>
#include <term.h>
-/*
- * use_env is really a curses function - POSIX mandates it's in curses.h
- * But it has to live in terminfo because it must precede a call to setupterm().
- */
-#include <curses.h>
-
-static bool __use_env = true;
-
-void
-use_env(bool value)
-{
-
- __use_env = value;
-}
#define reterr(code, msg) \
do { \
if (errret == NULL) \
@@ -80,7 +64,6 @@
ti_setupterm(TERMINAL **nterm, const char *term, int fildes, int *errret)
{
int error;
- struct winsize win;
_DIAGASSERT(nterm != NULL);
@@ -122,25 +105,6 @@
reterrarg(0, "%s: generic terminal", term);
if (t_hard_copy(*nterm))
reterrarg(1, "%s: hardcopy terminal", term);
-
- /* If TIOCGWINSZ works, then set initial lines and columns. */
- if (ioctl(fildes, TIOCGWINSZ, &win) != -1 &&
- win.ws_row != 0 && win.ws_col != 0)
- {
- t_lines(*nterm) = win.ws_row;
- t_columns(*nterm) = win.ws_col;
- }
-
- /* POSIX 1003.2 requires that the environment override. */
- if (__use_env) {
- char *p;
-
- if ((p = getenv("LINES")) != NULL)
- t_lines(*nterm) = (int)strtol(p, NULL, 0);
- if ((p = getenv("COLUMNS")) != NULL)
- t_columns(*nterm) = (int)strtol(p, NULL, 0);
- }
-
/* POSIX requires 1 for success */
if (errret)
*errret = 1;
diff -r a448e2b3fbb8 -r 20e136c1223b lib/libterminfo/term.h
--- a/lib/libterminfo/term.h Thu Mar 23 00:23:29 2017 +0000
+++ b/lib/libterminfo/term.h Thu Mar 23 00:36:37 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: term.h,v 1.20 2017/03/23 00:23:29 roy Exp $ */
+/* $NetBSD: term.h,v 1.21 2017/03/23 00:36:37 roy Exp $ */
/*
* Copyright (c) 2009, 2010, 2011, 2013 The NetBSD Foundation, Inc.
@@ -1933,8 +1933,8 @@
/* We need to expose these so that the macros work */
const char *name;
const char *desc;
- signed char *flags;
- short *nums;
+ const signed char *flags;
+ const short *nums;
const char **strs;
} TERMINAL;
#endif
Home |
Main Index |
Thread Index |
Old Index