[git commit] lineedit: use stdout for shell history builtin

Denys Vlasenko vda.linux at googlemail.com
Fri Sep 27 18:16:23 UTC 2024


commit: https://git.busybox.net/busybox/commit/?id=39c5c08b28f14e02611d5c79e357fb7432da1e25
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

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 <rmy at pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/lineedit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


More information about the busybox-cvs mailing list