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 -p0 < $0;;
11
-unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
13
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
18
# DP: bash-3.2 upstream patch bash32-041
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
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.
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
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' */
46
/* The number of lines that Bash has added to this history session. The
49
history_expansion_inhibited = 1;
51
! remember_on_history = interact != 0;
52
history_inhibit_expansion_function = bash_history_inhibit_expansion;
55
history_expansion_inhibited = 1;
57
! remember_on_history = enable_history_list = interact != 0;
58
history_inhibit_expansion_function = bash_history_inhibit_expansion;
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
64
#endif /* BANG_HISTORY */
66
! { "history", '\0', &remember_on_history, bash_set_history, (setopt_get_func_t *)NULL },
68
{ "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
70
#endif /* BANG_HISTORY */
72
! { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
74
{ "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
78
if (on_or_off == FLAG_ON)
80
+ enable_history_list = 1;
81
bash_history_enable ();
82
if (history_lines_this_session == 0)
87
! bash_history_disable ();
88
! return (1 - remember_on_history);
95
! enable_history_list = 0;
96
! bash_history_disable ();
98
! return (1 - enable_history_list);
104
#if defined (HISTORY)
105
! remember_on_history = 1;
110
#if defined (HISTORY)
111
! remember_on_history = enable_history_list = 1;
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
119
static int cat_file __P((REDIRECT *));
121
+ #if defined (HISTORY)
123
+ set_history_remembering ()
125
+ remember_on_history = enable_history_list;
129
/* How to force parse_and_execute () to clean up after itself. */
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)
140
#if defined (HISTORY)
141
! if (parse_and_execute_level == 0)
142
! add_unwind_protect (set_history_remembering, (char *)NULL);
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
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
163
looks for to find the patch level (for the sccs version string). */
165
! #define PATCHLEVEL 40
167
#endif /* _PATCHLEVEL_H_ */
169
looks for to find the patch level (for the sccs version string). */
171
! #define PATCHLEVEL 41
173
#endif /* _PATCHLEVEL_H_ */