X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Ftinfo_driver.c;h=0118f20226345705adbc47ee5a69907a20c7c33a;hb=5bfda8791637989e00be64748603cf4be2efbce5;hp=6d49c000271ae1615bfa5720dab49e3fed59ca20;hpb=26001c55f3e698f2467ee6e4a6c376bed9be6439;p=ncurses.git diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 6d49c000..0118f202 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -50,7 +50,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.21 2012/07/15 00:20:43 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.24 2012/07/28 20:12:11 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -361,7 +361,7 @@ drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) *linep = (int) lines; *colp = (int) columns; - if (useEnv) { + if (useEnv || useTioctl) { int value; #ifdef __EMX__ @@ -400,35 +400,35 @@ drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) } #endif /* HAVE_SIZECHANGE */ - if (useTioctl) { - char buf[128]; + if (useEnv) { + if (useTioctl) { + /* + * If environment variables are used, update them. + */ + if ((sp == 0 || !sp->_filtered) && _nc_getenv_num("LINES") > 0) { + _nc_setenv_num("LINES", *linep); + } + if (_nc_getenv_num("COLUMNS") > 0) { + _nc_setenv_num("COLUMNS", *colp); + } + } /* - * If environment variables are used, update them. + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. */ - if ((sp == 0 || !sp->_filtered) && _nc_getenv_num("LINES") > 0) { - _nc_setenv_num("LINES", *linep); + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); } - if (_nc_getenv_num("COLUMNS") > 0) { - _nc_setenv_num("COLUMNS", *colp); + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); } } - /* - * Finally, look for environment variables. - * - * Solaris lets users override either dimension with an environment - * variable. - */ - if ((value = _nc_getenv_num("LINES")) > 0) { - *linep = value; - T(("screen size: environment LINES = %d", *linep)); - } - if ((value = _nc_getenv_num("COLUMNS")) > 0) { - *colp = value; - T(("screen size: environment COLUMNS = %d", *colp)); - } - /* if we can't get dynamic info about the size, use static */ if (*linep <= 0) { *linep = (int) lines; @@ -634,13 +634,11 @@ drv_screen_init(SCREEN *sp) static void drv_init(TERMINAL_CONTROL_BLOCK * TCB) { - SCREEN *sp; TERMINAL *trm; AssertTCB(); trm = (TERMINAL *) TCB; - sp = TCB->csp; TCB->info.initcolor = VALID_STRING(initialize_color); TCB->info.canchange = can_change;