From patchwork Tue Sep 22 17:24:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 10272 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "YR2" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4hq6R86jsGz3xTH for ; Tue, 22 Sep 2026 17:24:36 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "YE1" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4hq6R638ljz8fG for ; Tue, 22 Sep 2026 17:24:34 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4hq6R32XsNz36XK for ; Tue, 22 Sep 2026 17:24:31 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "YR2" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4hq6Qy35hdz34nl for ; Tue, 22 Sep 2026 17:24:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4hq6Qw2jJHz6rZ; Tue, 22 Sep 2026 17:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1790097864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JaQnLNb//N4esi1c+1GYEO8pQsNoW0kkDIHTGKLJMng=; b=nDE+70S8aSxlh06rDkw7EcOqeoljgxCRgAJkSio7k0dnS7O8g0+uth0WInn/L+X9kzld/i CLEguWkpoQvz/d8WsW4uht5QaiOTeIxVDoPNgDNRYxn7XkX0Dfq9ENbdifZJgVBK6mNh5L WNKU+oTuv70K5zFACAerfcdfXMYHYeuRNrwez04P0Rbl2V4lq6V7TmrHBrCT47c5/ZpelF HBrsCTgLslelHPdwLTzM+QjVODKSnSjK/30dqMNH7aLUAx6qup6cSlJjGprTSi+N4yCFBX iwwDhFjBw6T+H4RUVQ30TKvDtvEop01qC6B74uQHKA20ZMbwG/wcWiwbMCjrPQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1790097864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JaQnLNb//N4esi1c+1GYEO8pQsNoW0kkDIHTGKLJMng=; b=2iaJhFF5felBuqNFUsrlGJoi7Xfp271vS+iQNoxtwumFX6AY+nk2IE7/N+KdxA1PYg8OO3 T+PPbBTzKj48CvAw== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH] readline: Update to version 8.3 Patch-6 Date: Tue, 22 Sep 2026 19:24:12 +0200 Message-ID: <20260922172417.3447503-11-adolf.belka@ipfire.org> In-Reply-To: <20260922172417.3447503-1-adolf.belka@ipfire.org> References: <20260922172417.3447503-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 - Update from version 8.3 Patch-3 to 8.3 Patch-6 - No change in rootfile - Changelog Patch-6 If readline handles a SIGWINCH and resizes its idea of the screen dimensions, it needs to recompute the columns where the prompt wraps lines every time, not just when the screen width decreases. Patch-5 This patch fixes two problems with the redisplay code. The first is a crash that results if the initial prompt contains more than 256 wrapped lines. The second is a fix to the redisplay code when the first several characters of the prompt string are identical, but the prompt has changed and needs to be redrawn. If these first few characters are part of an escape sequence, the entire sequence needs to be redrawn. Patch-4 If readline is invoked with the cursor somewhere other than column 0, and the prompt contains multibyte characters, the display algorithm needs to use a buffer offset, instead of the physical prompt length, to determine whether or not to reprint the prompt from column 0 because the cursor is before the last invisible character in the prompt string. Signed-off-by: Adolf Belka --- lfs/readline | 4 +- src/patches/readline/readline83-004 | 61 ++++++++++++++++++++++++++ src/patches/readline/readline83-005 | 67 +++++++++++++++++++++++++++++ src/patches/readline/readline83-006 | 47 ++++++++++++++++++++ 4 files changed, 177 insertions(+), 2 deletions(-) create mode 100644 src/patches/readline/readline83-004 create mode 100644 src/patches/readline/readline83-005 create mode 100644 src/patches/readline/readline83-006 diff --git a/lfs/readline b/lfs/readline index 57ecea815..37769c2ca 100644 --- a/lfs/readline +++ b/lfs/readline @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2025 IPFire Team # +# Copyright (C) 2007-2026 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -25,7 +25,7 @@ include Config VER = 8.3 -PATCHVER = 3 +PATCHVER = 6 # https://ftp.gnu.org/gnu/readline/ THISAPP = readline-$(VER) diff --git a/src/patches/readline/readline83-004 b/src/patches/readline/readline83-004 new file mode 100644 index 000000000..f743af8dc --- /dev/null +++ b/src/patches/readline/readline83-004 @@ -0,0 +1,61 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.3 +Patch-ID: readline83-004 + +Bug-Reported-by: Lennart Ackermans +Bug-Reference-ID: +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-05/msg00066.html + +Bug-Description: + +If readline is invoked with the cursor somewhere other than column 0, and +the prompt contains multibyte characters, the display algorithm needs to +use a buffer offset, instead of the physical prompt length, to determine +whether or not to reprint the prompt from column 0 because the cursor is +before the last invisible character in the prompt string. + +Patch (apply with `patch -p0'): + +Lennart Ackermans 5/19/2026 + +*** ../readline-8.3-patched/display.c Thu Sep 4 11:55:37 2025 +--- display.c Fri May 22 14:55:01 2026 +*************** +*** 1498,1502 **** + only need to reprint it if the cursor is before the last + invisible character in the prompt string. */ +- /* XXX - why not use local_prompt_len? */ + nleft = prompt_visible_length + wrap_offset; + if (cursor_linenum == prompt_last_screen_line) +--- 1498,1501 ---- +*************** +*** 1510,1518 **** + buffer position, an index into curline + (local_prompt + pmt_offset) */ +! cursor_bufpos = pmt_offset; +! if (mb_cur_max == 1 || rl_byte_oriented) +! cursor_bufpos += _rl_last_c_pos; +! else +! cursor_bufpos += _rl_last_c_pos + curline_invchars; + + if (local_prompt && local_prompt_invis_chars[cursor_linenum] && +--- 1509,1513 ---- + buffer position, an index into curline + (local_prompt + pmt_offset) */ +! cursor_bufpos = pmt_offset + local_prompt_len; + + if (local_prompt && local_prompt_invis_chars[cursor_linenum] && + +*** ../readline-8.3/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2024-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 3 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 4 diff --git a/src/patches/readline/readline83-005 b/src/patches/readline/readline83-005 new file mode 100644 index 000000000..e0f1004b1 --- /dev/null +++ b/src/patches/readline/readline83-005 @@ -0,0 +1,67 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.3 +Patch-ID: readline83-005 + +Bug-Reported-by: Ben Kallus + Derek Schrock +Bug-Reference-ID: + +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2026-06/msg00005.html + https://lists.gnu.org/archive/html/bug-readline/2026-06/msg00002.html + +Bug-Description: + +This patch fixes two problems with the redisplay code. The first is a +crash that results if the initial prompt contains more than 256 wrapped +lines. The second is a fix to the redisplay code when the first several +characters of the prompt string are identical, but the prompt has changed +and needs to be redrawn. If these first few characters are part of an escape +sequence, the entire sequence needs to be redrawn. + +Patch (apply with `patch -p0'): + +*** ../readline-8.3-patched/display.c Fri May 22 14:55:01 2026 +--- display.c Fri Jun 26 11:08:53 2026 +*************** +*** 1025,1028 **** +--- 1025,1029 ---- + { + temp = local_prompt_newlines[newlines+1]; ++ CHECK_INV_LBREAKS (); + inv_lbreaks[++newlines] = temp; + } +*************** +*** 2262,2270 **** + nd = nfd - new; /* nd, od are buffer indexes */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && +! _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 && + (((od > 0 || nd > 0) && (od <= prompt_last_invisible || nd <= prompt_last_invisible)) || + ((od >= lendiff) && _rl_last_c_pos < PROMPT_ENDING_INDEX))) + { +! _rl_cr (); + if (modmark) + _rl_output_some_chars ("*", 1); +--- 2266,2275 ---- + nd = nfd - new; /* nd, od are buffer indexes */ + if (current_line == 0 && !_rl_horizontal_scroll_mode && +! _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos >= 0 && + (((od > 0 || nd > 0) && (od <= prompt_last_invisible || nd <= prompt_last_invisible)) || + ((od >= lendiff) && _rl_last_c_pos < PROMPT_ENDING_INDEX))) + { +! if (_rl_last_c_pos > 0) +! _rl_cr (); + if (modmark) + _rl_output_some_chars ("*", 1); +*** ../readline-8.3/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2024-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 4 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 5 diff --git a/src/patches/readline/readline83-006 b/src/patches/readline/readline83-006 new file mode 100644 index 000000000..2bbf8eba6 --- /dev/null +++ b/src/patches/readline/readline83-006 @@ -0,0 +1,47 @@ + READLINE PATCH REPORT + ===================== + +Readline-Release: 8.3 +Patch-ID: readline83-006 + +Bug-Reported-by: Félix Bouynot +Bug-Reference-ID: <39c9472ddcf23881693380c4b895dd3799b45cec.camel@setenforce.one> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2026-05/msg00065.html + +Bug-Description: + +If readline handles a SIGWINCH and resizes its idea of the screen +dimensions, it needs to recompute the columns where the prompt wraps +lines every time, not just when the screen width decreases. + +Patch (apply with `patch -p0'): + +*** ../readline-8.3-patched/display.c Thu Sep 4 11:55:37 2025 +--- display.c Fri May 22 14:55:01 2026 +*************** +*** 3526,3531 **** + rl_crlf (); + +! if (_rl_screenwidth < prompt_visible_length) +! _rl_reset_prompt (); /* update local_prompt_newlines array */ + + /* Redraw only the last line of a multi-line prompt. */ +--- 3521,3527 ---- + rl_crlf (); + +! /* Let expand_prompt() update local_prompt_newlines and local_prompt_invis_chars +! arrays */ +! _rl_reset_prompt (); + + /* Redraw only the last line of a multi-line prompt. */ +*** ../readline-8.3/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2024-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 5 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 6