old/more/more.c
/*
** Come here if a signal for a window size change is received
*/
Come here if a signal for a window size change is received
Come here if a signal for a window size change is received
void
chgwinsz()
{
    struct winsize win;
    (void) signal(SIGWINCH, SIG_IGN);
    if (ioctl(fileno(stdout), TIOCGWINSZ, &win) != -1) {
	if (win.ws_row != 0) {
	    Lpp = win.ws_row;
	    nscroll = Lpp/2 - 1;
	    if (nscroll <= 0)
		nscroll = 1;
	    dlines = Lpp - (noscroll ? 1 : 2);
	}
	if (win.ws_col != 0)
	    Mcol = win.ws_col;
    }
    (void) signal(SIGWINCH, chgwinsz);
}
void chgwinsz ( ) { struct winsize win ; ( void ) signal ( SIGWINCH , SIG_IGN ) ; if ( ioctl ( fileno ( stdout ) , TIOCGWINSZ , & win ) != -1 ) { if ( win . ws_row != 0 ) { Lpp = win . ws_row ; nscroll = Lpp / 2 - 1 ; if ( nscroll <= 0 ) nscroll = 1 ; dlines = Lpp - ( noscroll ? 1 : 2 ) ; } if ( win . ws_col != 0 ) Mcol = win . ws_col ; } ( void ) signal ( SIGWINCH , chgwinsz ) ; }
Come here if a signal for a window size change is received
Come here if a signal for a window size change is received