- Add pass-test_write_read_limited_history.patch:

Fix readline history truncation when length is reduced

  The `readline.set_history_length()` function did not previously
  truncate the in-memory history when the new length was set to
  a value smaller than the current number of history items. This
  could lead to unexpected behavior where `get_history_length()`
  would still report the old length and writing the history to a
  file would write more entries than the new limit.

  This patch modifies `set_history_length()` to explicitly
  remove the oldest history entries using `remove_history()`
  when the length is decreased, ensuring the in-memory history
  is correctly truncated to the new limit. This brings the
  function's behavior in line with expectations and fixes
  failures in `test_write_read_limited_history`.
This commit is contained in:
2025-11-19 20:21:57 +01:00
parent 7ae3f5fa36
commit ffa140fab3
3 changed files with 65 additions and 0 deletions

View File

@@ -192,6 +192,9 @@ Patch46: gh139257-Support-docutils-0.22.patch
# PATCH-FIX-UPSTREAM CVE-2025-6075-expandvars-perf-degrad.patch bsc#1252974 mcepl@suse.com
# Avoid potential quadratic complexity vulnerabilities in path modules
Patch47: CVE-2025-6075-expandvars-perf-degrad.patch
# PATCH-FIX-UPSTREAM pass-test_write_read_limited_history.patch bsc#[0-9]+ mcepl@suse.com
# Fix readline history truncation when length is reduced
Patch48: pass-test_write_read_limited_history.patch
BuildRequires: autoconf-archive
BuildRequires: automake
BuildRequires: fdupes