~ubuntu-branches/ubuntu/precise/bash/precise

« back to all changes in this revision

Viewing changes to debian/patches/bash42-009.dpatch

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-11-30 11:30:24 UTC
  • mfrom: (2.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20111130113024-hztzp5jwcx4roydf
Tags: 4.2-1ubuntu1
* Merge with Debian; remaining changes:
  - Build from the upstream sources, build the documentation in info format.
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases. 
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh -e
2
 
 
3
 
if [ $# -eq 3 -a "$2" = '-d' ]; then
4
 
    pdir="-d $3"
5
 
elif [ $# -ne 1 ]; then
6
 
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7
 
    exit 1
8
 
fi
9
 
case "$1" in
10
 
    -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
11
 
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
12
 
    *)
13
 
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14
 
        exit 1
15
 
esac
16
 
exit 0
17
 
 
18
 
# DP: bash-4.2 upstream patch 009
19
 
 
20
 
                             BASH PATCH REPORT
21
 
                             =================
22
 
 
23
 
Bash-Release:   4.2
24
 
Patch-ID:       bash42-009
25
 
 
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
29
 
 
30
 
Bug-Description:
31
 
 
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.
35
 
 
36
 
Patch (apply with `patch -p0'):
37
 
 
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
40
 
***************
41
 
*** 305,309 ****
42
 
  
43
 
    /* XXX */
44
 
!   if (saved_command_line_count > 0 && i == last_hist && hlist[last_hist] == 0)
45
 
      while (last_hist >= 0 && hlist[last_hist] == 0)
46
 
        last_hist--;
47
 
--- 305,309 ----
48
 
  
49
 
    /* XXX */
50
 
!   if (i == last_hist && hlist[last_hist] == 0)
51
 
      while (last_hist >= 0 && hlist[last_hist] == 0)
52
 
        last_hist--;
53
 
***************
54
 
*** 476,480 ****
55
 
  {
56
 
    int sign, n, clen, rh;
57
 
!   register int i, j;
58
 
    register char *s;
59
 
  
60
 
--- 476,480 ----
61
 
  {
62
 
    int sign, n, clen, rh;
63
 
!   register int i, j, last_hist;
64
 
    register char *s;
65
 
  
66
 
***************
67
 
*** 496,500 ****
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;
71
 
  
72
 
    /* No specification defaults to most recent command. */
73
 
--- 496,508 ----
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;
77
 
78
 
!   if (i == last_hist && hlist[last_hist] == 0)
79
 
!     while (last_hist >= 0 && hlist[last_hist] == 0)
80
 
!       last_hist--;
81
 
!   if (last_hist < 0)
82
 
!     return (-1);
83
 
84
 
!   i = last_hist;
85
 
  
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
89
 
***************
90
 
*** 26,30 ****
91
 
     looks for to find the patch level (for the sccs version string). */
92
 
  
93
 
! #define PATCHLEVEL 8
94
 
  
95
 
  #endif /* _PATCHLEVEL_H_ */
96
 
--- 26,30 ----
97
 
     looks for to find the patch level (for the sccs version string). */
98
 
  
99
 
! #define PATCHLEVEL 9
100
 
  
101
 
  #endif /* _PATCHLEVEL_H_ */