Files
packages/utils/bash/patches/008-bash-5.3-patch-9.patch
Wei-Ting Yang 4a02dcb1c3 bash: update to 5.3 patch level 9
- Fix posix-mode issue with "wait -n", where it can return process IDs
  outside the requested set
- Do not try to use shm_open, there is too much variance in behavior
  across systems
- Remove internal quoting that causes failures when expanding nested
  array subscripts in an arithmetic context
- Fix issue with source when read(2) returns fewer characters than
  fstat(2) says are available
- Fix crash when restoring default disposition for SIGINT in
  asynchronous subshell
- Fix issues with range expressions and non-ascii characters in glob
  patterns when globasciiranges is enabled
- Fix issue where nofork command substitutions can affect
  redirections in the calling shell
- Fix issue with calling mbrtowc too much when translating
  ansic-single-quoted strings
- Fix crash when interrupting reverse i-search with ^C

Signed-off-by: Wei-Ting Yang <williamatcg@gmail.com>
2026-01-18 07:19:05 +02:00

54 lines
1.6 KiB
Diff

From 637f5c8696a6adc9b4519f1cd74aa78492266b7f Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Wed, 10 Dec 2025 11:30:51 -0500
Subject: Bash-5.3 patch 9: fix crash when interrupting reverse i-search with
^C
--- a/lib/readline/input.c
+++ b/lib/readline/input.c
@@ -971,11 +971,11 @@ postproc_signal:
call the application's signal event hook. */
if (rl_signal_event_hook)
(*rl_signal_event_hook) ();
-#if defined (READLINE_CALLBACKS)
- else if (osig == SIGINT && (ostate & RL_STATE_CALLBACK) && (ostate & (RL_STATE_ISEARCH|RL_STATE_NSEARCH|RL_STATE_NUMERICARG)))
+ /* If the application's SIGINT handler returns, make sure we abort out of
+ searches and numeric arguments because we've freed necessary state. */
+ if (osig == SIGINT && (ostate & (RL_STATE_ISEARCH|RL_STATE_NSEARCH|RL_STATE_NUMERICARG)))
/* just these cases for now */
_rl_abort_internal ();
-#endif
}
}
--- a/lib/readline/isearch.c
+++ b/lib/readline/isearch.c
@@ -889,12 +889,14 @@ opcode_dispatch:
int
_rl_isearch_cleanup (_rl_search_cxt *cxt, int r)
{
+ RL_UNSETSTATE(RL_STATE_ISEARCH);
+ if (cxt == 0)
+ return (r != 0);
+
+ _rl_iscxt = 0;
if (r >= 0)
_rl_isearch_fini (cxt);
_rl_scxt_dispose (cxt, 0);
- _rl_iscxt = 0;
-
- RL_UNSETSTATE(RL_STATE_ISEARCH);
return (r != 0);
}
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 8
+#define PATCHLEVEL 9
#endif /* _PATCHLEVEL_H_ */