M. Feser KBS GmbH
Date: 10.01.2025

This patch fixes a bug introduced with the redirection to stderr
Some puts calls were still left, leading to a corrupted output
-------------------------------------------------------------------------
diff -ruPN a/libbb/lineedit.c b/libbb/lineedit.c
--- a/libbb/lineedit.c	2024-04-16 09:23:50.000000000 +0200
+++ b/libbb/lineedit.c	2025-01-07 11:11:50.000000000 +0100
@@ -451,7 +451,7 @@
 		 * 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); /* no implicit '\n' */
 #else
 		/* VT-10x terminals don't wrap cursor to next line when last char
 		 * on the line is printed - cursor stays "over" this char.
@@ -1170,9 +1170,9 @@
 			);
 		}
 		if (ENABLE_UNICODE_SUPPORT)
-			puts(printable_string(matches[n]));
+			fprintf(stderr, "%s\n", printable_string(matches[n]));
 		else
-			puts(matches[n]);
+			fprintf(stderr, "%s\n", matches[n]);
 	}
 }
 
