remove trailing spaces in top batch mode

Signed-off-by: Jan Görig <jgorig@redhat.com>
This commit is contained in:
Jim Warner 2011-06-01 13:58:06 +02:00 committed by Jan Görig
parent c2dcbef482
commit 91edf89810

7
top.h
View File

@ -401,9 +401,10 @@ typedef struct WIN_t {
. assumed to represent a complete screen ROW
. subject to optimization, thus MAY be discarded */
#define PUFF(fmt,arg...) do { \
char _str[ROWMAXSIZ]; \
snprintf(_str, sizeof(_str), fmt, ## arg); \
if (Batch) putp(_str); \
char _str[ROWMAXSIZ], *_eol; \
_eol = _str + snprintf(_str, sizeof(_str), fmt, ## arg); \
if (Batch) { \
while (*(--_eol) == ' '); *(++_eol) = '\0'; putp(_str); } \
else { \
char *_ptr = &Pseudo_screen[Pseudo_row * ROWMAXSIZ]; \
if (Pseudo_row + 1 < Screen_rows) ++Pseudo_row; \