[git commit] lineedit: fix printing lines during tab completion

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


commit: https://git.busybox.net/busybox/commit/?id=37abfb919dfa92132bc7a14c583016a46026729b
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Indentation and escape characters are all output to stderr now, but the
matches themself remained on stdout leading to garbled output on Tab
completion.

Print the results to stderr as well to fix this.

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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 151208c1c..db95fbb00 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1170,9 +1170,10 @@ static void showfiles(void)
 			);
 		}
 		if (ENABLE_UNICODE_SUPPORT)
-			puts(printable_string(matches[n]));
+			fputs(printable_string(matches[n]), stderr);
 		else
-			puts(matches[n]);
+			fputs(matches[n], stderr);
+		bb_putchar_stderr('\n');
 	}
 }
 


More information about the busybox-cvs mailing list