From e5b0547ac834dcd34c72df9aee1cf9c326c14b6f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 27 Sep 2024 19:35:50 +0200 Subject: lineedit: make save_history() FAST_FUNC function old new delta save_history 267 266 -1 hush_exit 98 97 -1 exitshell 140 138 -2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-4) Total: -4 bytes Signed-off-by: Denys Vlasenko --- libbb/lineedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb/lineedit.c') diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 543a3f11c..314fedf5c 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1555,7 +1555,7 @@ static void load_history(line_input_t *st_parm) } # if ENABLE_FEATURE_EDITING_SAVE_ON_EXIT -void save_history(line_input_t *st) +void FAST_FUNC save_history(line_input_t *st) { FILE *fp; -- cgit v1.2.3-55-g6feb From 39c5c08b28f14e02611d5c79e357fb7432da1e25 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 27 Jul 2024 07:51:35 +0100 Subject: lineedit: use stdout for shell history builtin Commit fd47f0567 (lineedit: print prompt and editing operations to stderr) changed various print statements to output to stderr. The change in show_history() caused the shell history builtin to send its output to stderr. Revert that part of the commit. function old new delta show_history 47 42 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5) Total: -5 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- libbb/lineedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb/lineedit.c') diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 314fedf5c..151208c1c 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -1463,7 +1463,7 @@ void FAST_FUNC show_history(const line_input_t *st) if (!st) return; for (i = 0; i < st->cnt_history; i++) - fprintf(stderr, "%4d %s\n", i, st->history[i]); + printf("%4d %s\n", i, st->history[i]); } # if ENABLE_FEATURE_EDITING_SAVEHISTORY -- cgit v1.2.3-55-g6feb