aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-07-27 07:59:41 +0100
committerRon Yorston <rmy@pobox.com>2024-07-27 07:59:41 +0100
commitfe927d870601af570b22889ecc267b008af35404 (patch)
tree3c3e7b033b94c0dbde8604de1b07b772784431ff
parent2628ffaceabcfcd614f9b09db98da82e98fb048b (diff)
downloadbusybox-w32-fe927d870601af570b22889ecc267b008af35404.tar.gz
busybox-w32-fe927d870601af570b22889ecc267b008af35404.tar.bz2
busybox-w32-fe927d870601af570b22889ecc267b008af35404.zip
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. Saves 16 bytes. (GitHub issue #433)
-rw-r--r--libbb/lineedit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index bd4a17348..7f26bb8e0 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1653,7 +1653,12 @@ void FAST_FUNC show_history(const line_input_t *st)
1653 if (!st) 1653 if (!st)
1654 return; 1654 return;
1655 for (i = 0; i < st->cnt_history; i++) 1655 for (i = 0; i < st->cnt_history; i++)
1656#if ENABLE_PLATFORM_MINGW32
1657 /* Upstream erred, a patch has been submitted */
1658 printf("%4d %s\n", i, st->history[i]);
1659#else
1656 fprintf(stderr, "%4d %s\n", i, st->history[i]); 1660 fprintf(stderr, "%4d %s\n", i, st->history[i]);
1661#endif
1657} 1662}
1658 1663
1659# if ENABLE_FEATURE_EDITING_SAVEHISTORY 1664# if ENABLE_FEATURE_EDITING_SAVEHISTORY