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

« back to all changes in this revision

Viewing changes to debian/patches/bash32-041.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-01 10:20:52 UTC
  • mto: (2.1.5 squeeze)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20090301102052-m2dnf334rdighg4r
Tags: 3.2-5
Apply upstream fixes 040 - 048.

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 -p0 < $0;;
 
11
    -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $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-3.2 upstream patch bash32-041
 
19
 
 
20
                             BASH PATCH REPORT
 
21
                             =================
 
22
 
 
23
Bash-Release: 3.2
 
24
Patch-ID: bash32-041
 
25
 
 
26
Bug-Reported-by:        Dan Jacobson <jidanni@jidanni.org>
 
27
Bug-Reference-ID:       <873arjs11h.fsf@jidanni.org>
 
28
Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2008-02/msg00049.html
 
29
 
 
30
Bug-Description:
 
31
 
 
32
Bash saved and restored the value of `set -o history' while sourcing files,
 
33
preventing users from turning off history with `set +o history' in .bashrc.
 
34
 
 
35
Patch:
 
36
 
 
37
*** ../bash-3.2-patched/bashhist.c      2005-12-26 13:31:16.000000000 -0500
 
38
--- bashhist.c  2008-08-17 13:07:40.000000000 -0400
 
39
***************
 
40
*** 81,84 ****
 
41
--- 81,85 ----
 
42
     becomes zero when we read lines from a file, for example. */
 
43
  int remember_on_history = 1;
 
44
+ int enable_history_list = 1;  /* value for `set -o history' */
 
45
  
 
46
  /* The number of lines that Bash has added to this history session.  The
 
47
***************
 
48
*** 235,239 ****
 
49
    history_expansion_inhibited = 1;
 
50
  #endif
 
51
!   remember_on_history = interact != 0;
 
52
    history_inhibit_expansion_function = bash_history_inhibit_expansion;
 
53
  }
 
54
--- 236,240 ----
 
55
    history_expansion_inhibited = 1;
 
56
  #endif
 
57
!   remember_on_history = enable_history_list = interact != 0;
 
58
    history_inhibit_expansion_function = bash_history_inhibit_expansion;
 
59
  }
 
60
*** ../bash-3.2-patched/builtins/set.def        2006-07-27 09:41:43.000000000 -0400
 
61
--- builtins/set.def    2008-08-14 16:33:41.000000000 -0400
 
62
***************
 
63
*** 190,194 ****
 
64
  #endif /* BANG_HISTORY */
 
65
  #if defined (HISTORY)
 
66
!   { "history",   '\0', &remember_on_history, bash_set_history, (setopt_get_func_t *)NULL },
 
67
  #endif
 
68
    { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
 
69
--- 198,202 ----
 
70
  #endif /* BANG_HISTORY */
 
71
  #if defined (HISTORY)
 
72
!   { "history",   '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
 
73
  #endif
 
74
    { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
 
75
***************
 
76
*** 382,385 ****
 
77
--- 390,394 ----
 
78
    if (on_or_off == FLAG_ON)
 
79
      {
 
80
+       enable_history_list = 1;
 
81
        bash_history_enable ();
 
82
        if (history_lines_this_session == 0)
 
83
***************
 
84
*** 387,392 ****
 
85
      }
 
86
    else
 
87
!     bash_history_disable ();
 
88
!   return (1 - remember_on_history);
 
89
  }
 
90
  #endif
 
91
--- 396,404 ----
 
92
      }
 
93
    else
 
94
!     {
 
95
!       enable_history_list = 0;
 
96
!       bash_history_disable ();
 
97
!     }
 
98
!   return (1 - enable_history_list);
 
99
  }
 
100
  #endif
 
101
***************
 
102
*** 566,570 ****
 
103
  {
 
104
  #if defined (HISTORY)
 
105
!   remember_on_history = 1;
 
106
  #endif
 
107
    ignoreeof = 0;
 
108
--- 578,582 ----
 
109
  {
 
110
  #if defined (HISTORY)
 
111
!   remember_on_history = enable_history_list = 1;
 
112
  #endif
 
113
    ignoreeof = 0;
 
114
*** ../bash-3.2-patched/builtins/evalstring.c   2006-07-28 15:12:16.000000000 -0400
 
115
--- builtins/evalstring.c       2008-11-10 21:17:16.000000000 -0500
 
116
***************
 
117
*** 68,71 ****
 
118
--- 68,79 ----
 
119
  static int cat_file __P((REDIRECT *));
 
120
  
 
121
+ #if defined (HISTORY)
 
122
+ static void
 
123
+ set_history_remembering ()
 
124
+ {
 
125
+   remember_on_history = enable_history_list;
 
126
+ }
 
127
+ #endif
 
128
 
129
  /* How to force parse_and_execute () to clean up after itself. */
 
130
  void
 
131
***************
 
132
*** 116,120 ****
 
133
  
 
134
  #if defined (HISTORY)
 
135
!   unwind_protect_int (remember_on_history);   /* can be used in scripts */
 
136
  #  if defined (BANG_HISTORY)
 
137
    if (interactive_shell)
 
138
--- 124,131 ----
 
139
  
 
140
  #if defined (HISTORY)
 
141
!   if (parse_and_execute_level == 0)
 
142
!     add_unwind_protect (set_history_remembering, (char *)NULL);
 
143
!   else
 
144
!     unwind_protect_int (remember_on_history); /* can be used in scripts */
 
145
  #  if defined (BANG_HISTORY)
 
146
    if (interactive_shell)
 
147
*** ../bash-3.2-patched/bashhist.h      2005-07-01 15:44:41.000000000 -0400
 
148
--- bashhist.h  2008-08-17 12:51:07.000000000 -0400
 
149
***************
 
150
*** 32,35 ****
 
151
--- 32,38 ----
 
152
  
 
153
  extern int remember_on_history;
 
154
+ extern int enable_history_list;               /* value for `set -o history' */
 
155
+ extern int literal_history;           /* controlled by `shopt lithist' */
 
156
+ extern int force_append_history;
 
157
  extern int history_lines_this_session;
 
158
  extern int history_lines_in_file;
 
159
*** ../bash-3.2/patchlevel.h    Thu Apr 13 08:31:04 2006
 
160
--- patchlevel.h        Mon Oct 16 14:22:54 2006
 
161
***************
 
162
*** 26,30 ****
 
163
     looks for to find the patch level (for the sccs version string). */
 
164
  
 
165
! #define PATCHLEVEL 40
 
166
  
 
167
  #endif /* _PATCHLEVEL_H_ */
 
168
--- 26,30 ----
 
169
     looks for to find the patch level (for the sccs version string). */
 
170
  
 
171
! #define PATCHLEVEL 41
 
172
  
 
173
  #endif /* _PATCHLEVEL_H_ */