From 589090f79a18d3fac33922da7f41957672b623d6 Mon Sep 17 00:00:00 2001 From: Bjoern Walk Date: Mon, 29 Apr 2024 19:48:24 +0200 Subject: [PATCH] hyptop: Move separator line to table update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The separator line is written as part of the input processing step and is better be moved to the place where the table is actually written. Same goes for the terminating '\n' which is performed as the final step while updating the terminal in batch mode. While at it, use the designated print functions over raw printf(). Reviewed-by: Mete Durlu Reviewed-by: Steffen Eiden Signed-off-by: Bjoern Walk Signed-off-by: Jan Höppner --- hyptop/hyptop.c | 1 - hyptop/opts.c | 3 --- hyptop/table.c | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hyptop/hyptop.c b/hyptop/hyptop.c index 29dbb14e..db059a11 100644 --- a/hyptop/hyptop.c +++ b/hyptop/hyptop.c @@ -296,7 +296,6 @@ static void l_update_term_curses(void) static void l_update_term_batch(void) { g.w.cur->update_term(g.w.cur); - printf("\n"); } /* diff --git a/hyptop/opts.c b/hyptop/opts.c index 68596efa..9f315aee 100644 --- a/hyptop/opts.c +++ b/hyptop/opts.c @@ -435,8 +435,5 @@ void opts_iterations_next(void) if (g.o.iterations_act >= g.o.iterations) hyptop_exit(0); } - if (g.o.batch_mode_specified) - printf("---------------------------------------------------" - "----------------------------\n"); } diff --git a/hyptop/table.c b/hyptop/table.c index 13051b49..62ea0c34 100644 --- a/hyptop/table.c +++ b/hyptop/table.c @@ -950,6 +950,9 @@ static void l_table_print_all(struct table *t) hyptop_print_nl(); } l_row_print(t, t->row_last); + hyptop_print_nl(); + hyptop_printf("------------------------------------------------------" + "-------------------------\n"); } /*