]> git.pld-linux.org Git - packages/bash.git/blame - bash42-009
- up to 4.2.10
[packages/bash.git] / bash42-009
CommitLineData
74aff021
AM
1 BASH PATCH REPORT
2 =================
3
4Bash-Release: 4.2
5Patch-ID: bash42-009
6
7Bug-Reported-by: <piuma@piumalab.org>
8Bug-Reference-ID: <4DAAC0DB.7060606@piumalab.org>
9Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-04/msg00075.html
10
11Bug-Description:
12
13Under certain circumstances, running `fc -l' two times in succession with a
14relative history offset at the end of the history will result in an incorrect
15calculation of the last history entry and a seg fault.
16
17Patch (apply with `patch -p0'):
18
19*** ../bash-4.2-patched/builtins/fc.def 2010-05-30 18:25:38.000000000 -0400
20--- builtins/fc.def 2011-04-19 15:46:17.000000000 -0400
21***************
22*** 305,309 ****
23
24 /* XXX */
25! if (saved_command_line_count > 0 && i == last_hist && hlist[last_hist] == 0)
26 while (last_hist >= 0 && hlist[last_hist] == 0)
27 last_hist--;
28--- 305,309 ----
29
30 /* XXX */
31! if (i == last_hist && hlist[last_hist] == 0)
32 while (last_hist >= 0 && hlist[last_hist] == 0)
33 last_hist--;
34***************
35*** 476,480 ****
36 {
37 int sign, n, clen, rh;
38! register int i, j;
39 register char *s;
40
41--- 476,480 ----
42 {
43 int sign, n, clen, rh;
44! register int i, j, last_hist;
45 register char *s;
46
47***************
48*** 496,500 ****
49 calculation as if it were on. */
50 rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
51! i -= rh + hist_last_line_added;
52
53 /* No specification defaults to most recent command. */
54--- 496,508 ----
55 calculation as if it were on. */
56 rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
57! last_hist = i - rh - hist_last_line_added;
58!
59! if (i == last_hist && hlist[last_hist] == 0)
60! while (last_hist >= 0 && hlist[last_hist] == 0)
61! last_hist--;
62! if (last_hist < 0)
63! return (-1);
64!
65! i = last_hist;
66
67 /* No specification defaults to most recent command. */
68*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
69--- patchlevel.h Thu Feb 24 21:41:34 2011
70***************
71*** 26,30 ****
72 looks for to find the patch level (for the sccs version string). */
73
74! #define PATCHLEVEL 8
75
76 #endif /* _PATCHLEVEL_H_ */
77--- 26,30 ----
78 looks for to find the patch level (for the sccs version string). */
79
80! #define PATCHLEVEL 9
81
82 #endif /* _PATCHLEVEL_H_ */
This page took 0.064359 seconds and 4 git commands to generate.