[git commit] lineedit: fix left-over print to stdout

Denys Vlasenko vda.linux at googlemail.com
Tue Jul 1 10:25:29 UTC 2025


commit: https://git.busybox.net/busybox/commit/?id=952a7b9cececa314b2f5a9827dac8213b1a74460
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

There's code printing to stderr both before and after the single call to
puts inside put_cur_glyph_and_inc_cursor().

This is likely an oversight as we want everything to go through the
same file descriptor, so switch it over to fputs.

Fixes: fd47f056765a ("lineedit: print prompt and editing operations to stderr")
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
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 db95fbb00..ea216e16c 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -451,7 +451,7 @@ static void put_cur_glyph_and_inc_cursor(void)
 		 * have automargin (IOW: it is moving cursor to next line
 		 * by itself (which is wrong for VT-10x terminals)),
 		 * this will break things: there will be one extra empty line */
-		puts("\r"); /* + implicit '\n' */
+		fputs("\r\n", stderr);
 #else
 		/* VT-10x terminals don't wrap cursor to next line when last char
 		 * on the line is printed - cursor stays "over" this char.


More information about the busybox-cvs mailing list