From 04e7814f9caaa53cfe5324198b60b051fb612dfe Mon Sep 17 00:00:00 2001 From: albert <> Date: Tue, 6 Jul 2004 04:44:18 +0000 Subject: [PATCH] be crudely tolerant of crude tty emulators --- NEWS | 1 + top.c | 34 ++++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 4105c512..7e4bcedf 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ avoid warning about -lncurses when not linking -- thanks FLWM ps: personality-specific -x support (HP-UX and SVR4-MP) ps: k option, same as --sort vmstat: fixed -d +top: try to handle terminals lacking rmam and smam procps-3.2.0 --> procps-3.2.1 diff --git a/top.c b/top.c index e6baa848..4932979e 100644 --- a/top.c +++ b/top.c @@ -337,6 +337,9 @@ static void bye_bye (int eno, const char *str) fflush(stdout); #ifdef ATEOJ_REPORT + + fprintf(stderr, "\n Screen_cols %d\n", Screen_cols); + fprintf(stderr, "\nbye_bye's Summary report:" "\n\tProgram" @@ -351,20 +354,6 @@ static void bye_bye (int eno, const char *str) "\n\t Cap_can_goto = %s" "\n\t Screen_cols = %d, Screen_rows = %d" "\n\t Max_lines = %d, most recent Pseudo_size = %d" -#ifndef STDOUT_IOLBF - "\n\t Stdout_buf = %d, BUFSIZ = %u" -#endif - "\n\tWindows and Curwin->" - "\n\t sizeof(WIN_t) = %u, GROUPSMAX = %d" - "\n\t rc.winname = %s, grpname = %s" -#ifdef CASEUP_HEXES - "\n\t rc.winflags = %08X, maxpflgs = %d" -#else - "\n\t rc.winflags = %08x, maxpflgs = %d" -#endif - "\n\t rc.fieldscur = %s" - "\n\t winlines = %d, rc.maxtasks = %d, maxcmdln = %d" - "\n\t rc.sortindx = %d" "\n" , LINUX_VERSION_MAJOR(linux_version_code) , LINUX_VERSION_MINOR(linux_version_code) @@ -383,6 +372,21 @@ static void bye_bye (int eno, const char *str) , Cap_can_goto ? "yes" : "No!" , Screen_cols, Screen_rows , Max_lines, Pseudo_size + ); + + + fprintf(stderr, +#ifndef STDOUT_IOLBF + "\n\t Stdout_buf = %d, BUFSIZ = %u" +#endif + "\n\tWindows and Curwin->" + "\n\t sizeof(WIN_t) = %u, GROUPSMAX = %d" + "\n\t rc.winname = %s, grpname = %s" + "\n\t rc.winflags = %08x, maxpflgs = %d" + "\n\t rc.fieldscur = %s" + "\n\t winlines = %d, rc.maxtasks = %d, maxcmdln = %d" + "\n\t rc.sortindx = %d" + "\n" #ifndef STDOUT_IOLBF , sizeof(Stdout_buf), (unsigned)BUFSIZ #endif @@ -393,6 +397,8 @@ static void bye_bye (int eno, const char *str) , Curwin->winlines, Curwin->rc.maxtasks, Curwin->maxcmdln , Curwin->rc.sortindx ); + + #endif if (str) {