json-glib: update to 1.10.6
[oi-userland.git] / components / library / readline / patches / readline82-006.patch
blob9e315e88964c2c3ab79ca4f403528a12d1c57144
1 READLINE PATCH REPORT
2 =====================
4 Readline-Release: 8.2
5 Patch-ID: readline82-006
7 Bug-Reported-by: Tom de Vries <tdevries@suse.de>
8 Bug-Reference-ID:
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2022-09/msg00001.html
11 Bug-Description:
13 This is a variant of the same issue as the one fixed by patch 5. In this
14 case, the signal arrives and is pending before readline calls rl_getc().
15 When this happens, the pending signal will be handled by the loop, but may
16 alter or destroy some state that the callback uses. Readline needs to treat
17 this case the same way it would if a signal interrupts pselect/select, so
18 compound operations like searches and reading numeric arguments get cleaned
19 up properly.
21 Patch (apply with `patch -p0'):
23 *** ../readline-8.2-patched/input.c 2022-12-22 16:15:48.000000000 -0500
24 --- input.c 2023-01-10 11:53:45.000000000 -0500
25 ***************
26 *** 812,816 ****
27 rl_getc (FILE *stream)
29 ! int result;
30 unsigned char c;
31 int fd;
32 --- 812,816 ----
33 rl_getc (FILE *stream)
35 ! int result, ostate, osig;
36 unsigned char c;
37 int fd;
38 ***************
39 *** 823,828 ****
40 --- 823,842 ----
41 while (1)
43 + osig = _rl_caught_signal;
44 + ostate = rl_readline_state;
46 RL_CHECK_SIGNALS ();
48 + #if defined (READLINE_CALLBACKS)
49 + /* Do signal handling post-processing here, but just in callback mode
50 + for right now because the signal cleanup can change some of the
51 + callback state, and we need to either let the application have a
52 + chance to react or abort some current operation that gets cleaned
53 + up by rl_callback_sigcleanup(). If not, we'll just run through the
54 + loop again. */
55 + if (osig != 0 && (ostate & RL_STATE_CALLBACK))
56 + goto postproc_signal;
57 + #endif
59 /* We know at this point that _rl_caught_signal == 0 */
61 ***************
62 *** 888,891 ****
63 --- 902,908 ----
65 handle_error:
66 + osig = _rl_caught_signal;
67 + ostate = rl_readline_state;
69 /* If the error that we received was EINTR, then try again,
70 this is simply an interrupted system call to read (). We allow
71 ***************
72 *** 928,933 ****
73 --- 945,959 ----
74 #endif /* SIGALRM */
76 + postproc_signal:
77 + /* POSIX says read(2)/pselect(2)/select(2) don't return EINTR for any
78 + reason other than being interrupted by a signal, so we can safely
79 + call the application's signal event hook. */
80 if (rl_signal_event_hook)
81 (*rl_signal_event_hook) ();
82 + #if defined (READLINE_CALLBACKS)
83 + else if (osig == SIGINT && (ostate & RL_STATE_CALLBACK) && (ostate & (RL_STATE_ISEARCH|RL_STATE_NSEARCH|RL_STATE_NUMERICARG)))
84 + /* just these cases for now */
85 + _rl_abort_internal ();
86 + #endif
89 *** ../readline-8.2/patchlevel 2013-11-15 08:11:11.000000000 -0500
90 --- patchlevel 2014-03-21 08:28:40.000000000 -0400
91 ***************
92 *** 1,3 ****
93 # Do not edit -- exists only for use by patch
95 ! 5
96 --- 1,3 ----
97 # Do not edit -- exists only for use by patch
99 ! 6