3
if [ $# -eq 3 -a "$2" = '-d' ]; then
5
elif [ $# -ne 1 ]; then
6
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10
-patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
11
-unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
13
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
18
# DP: bash-4.2 upstream patch 009
26
Bug-Reported-by: <piuma@piumalab.org>
27
Bug-Reference-ID: <4DAAC0DB.7060606@piumalab.org>
28
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-04/msg00075.html
32
Under certain circumstances, running `fc -l' two times in succession with a
33
relative history offset at the end of the history will result in an incorrect
34
calculation of the last history entry and a seg fault.
36
Patch (apply with `patch -p0'):
38
*** ../bash-4.2-patched/builtins/fc.def 2010-05-30 18:25:38.000000000 -0400
39
--- ./builtins/fc.def 2011-04-19 15:46:17.000000000 -0400
44
! if (saved_command_line_count > 0 && i == last_hist && hlist[last_hist] == 0)
45
while (last_hist >= 0 && hlist[last_hist] == 0)
50
! if (i == last_hist && hlist[last_hist] == 0)
51
while (last_hist >= 0 && hlist[last_hist] == 0)
56
int sign, n, clen, rh;
62
int sign, n, clen, rh;
63
! register int i, j, last_hist;
68
calculation as if it were on. */
69
rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
70
! i -= rh + hist_last_line_added;
72
/* No specification defaults to most recent command. */
74
calculation as if it were on. */
75
rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
76
! last_hist = i - rh - hist_last_line_added;
78
! if (i == last_hist && hlist[last_hist] == 0)
79
! while (last_hist >= 0 && hlist[last_hist] == 0)
86
/* No specification defaults to most recent command. */
87
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
88
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
91
looks for to find the patch level (for the sccs version string). */
93
! #define PATCHLEVEL 8
95
#endif /* _PATCHLEVEL_H_ */
97
looks for to find the patch level (for the sccs version string). */
99
! #define PATCHLEVEL 9
101
#endif /* _PATCHLEVEL_H_ */