Thanks, applied as bfa6f385e37b7ab1d939ad40248e4a58d3b507f5.

Michael

[sent from post-receive hook]

On Fri, 09 May 2025 09:25:13 +0200, Michael Grzeschik 
<[email protected]> wrote:
> In busybox the tabcompletion was broken. With the recent patches this is
> fixed.
> 
> Signed-off-by: Michael Grzeschik <[email protected]>
> Message-Id: <[email protected]>
> Signed-off-by: Michael Olbrich <[email protected]>
> 
> diff --git 
> a/patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch
>  
> b/patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch
> new file mode 100644
> index 000000000000..d9864d8d79c0
> --- /dev/null
> +++ 
> b/patches/busybox-1.37.0/0204-lineedit-fix-printing-lines-during-tab-completion.patch
> @@ -0,0 +1,37 @@
> +From c443f2d2c67b5e5080632819980799c55b7bb89f Mon Sep 17 00:00:00 2001
> +From: Ahmad Fatoum <[email protected]>
> +Date: Thu, 17 Apr 2025 11:00:43 +0200
> +Subject: [PATCH 1/2] lineedit: fix printing lines during tab completion
> +
> +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 <[email protected]>
> +---
> + libbb/lineedit.c | 5 +++--
> + 1 file changed, 3 insertions(+), 2 deletions(-)
> +
> +diff --git a/libbb/lineedit.c b/libbb/lineedit.c
> +index 543a3f11c3e4..1f4b011008b6 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');
> +     }
> + }
> + 
> +-- 
> +2.39.5
> +
> diff --git 
> a/patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch 
> b/patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch
> new file mode 100644
> index 000000000000..6c0d00e18b59
> --- /dev/null
> +++ b/patches/busybox-1.37.0/0205-lineedit-fix-left-over-print-to-stdout.patch
> @@ -0,0 +1,33 @@
> +From 40a8532dea18363fb67466e1b02651cc964017e8 Mon Sep 17 00:00:00 2001
> +From: Ahmad Fatoum <[email protected]>
> +Date: Thu, 17 Apr 2025 11:00:43 +0200
> +Subject: [PATCH 2/2] lineedit: fix left-over print to stdout
> +
> +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 <[email protected]>
> +---
> + libbb/lineedit.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/libbb/lineedit.c b/libbb/lineedit.c
> +index 1f4b011008b6..206fc36ef5c0 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.
> +-- 
> +2.39.5
> +
> diff --git a/patches/busybox-1.37.0/series b/patches/busybox-1.37.0/series
> index 87fee50916c0..f403c5683e27 100644
> --- a/patches/busybox-1.37.0/series
> +++ b/patches/busybox-1.37.0/series
> @@ -7,4 +7,6 @@
>  0201-build-system-only-pass-real-libs-to-SELINUX_LIBS.patch
>  0202-scripts-trylink-honour-SKIP_STRIP-and-don-t-strip-if.patch
>  0203-tc-Fix-compilation-with-Linux-v6.8-rc1.patch
> -# e781b8c6838e27fd021f9c1a9f87654d  - git-ptx-patches magic
> +0204-lineedit-fix-printing-lines-during-tab-completion.patch
> +0205-lineedit-fix-left-over-print-to-stdout.patch
> +# de06cc1132910215a67ae025e9b0aaa9  - git-ptx-patches magic

Reply via email to