7 Bug-Reported-by: Dan Jacobson <jidanni@jidanni.org>
8 Bug-Reference-ID: <873arjs11h.fsf@jidanni.org>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2008-02/msg00049.html
13 Bash saved and restored the value of `set -o history' while sourcing files,
14 preventing users from turning off history with `set +o history' in .bashrc.
18 *** ../bash-3.2-patched/bashhist.c 2005-12-26 13:31:16.000000000 -0500
19 --- bashhist.c 2008-08-17 13:07:40.000000000 -0400
23 becomes zero when we read lines from a file, for example. */
24 int remember_on_history = 1;
25 + int enable_history_list = 1; /* value for `set -o history' */
27 /* The number of lines that Bash has added to this history session. The
30 history_expansion_inhibited = 1;
32 ! remember_on_history = interact != 0;
33 history_inhibit_expansion_function = bash_history_inhibit_expansion;
36 history_expansion_inhibited = 1;
38 ! remember_on_history = enable_history_list = interact != 0;
39 history_inhibit_expansion_function = bash_history_inhibit_expansion;
41 *** ../bash-3.2-patched/builtins/set.def 2006-07-27 09:41:43.000000000 -0400
42 --- builtins/set.def 2008-08-14 16:33:41.000000000 -0400
45 #endif /* BANG_HISTORY */
47 ! { "history", '\0', &remember_on_history, bash_set_history, (setopt_get_func_t *)NULL },
49 { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
51 #endif /* BANG_HISTORY */
53 ! { "history", '\0', &enable_history_list, bash_set_history, (setopt_get_func_t *)NULL },
55 { "ignoreeof", '\0', &ignoreeof, set_ignoreeof, (setopt_get_func_t *)NULL },
59 if (on_or_off == FLAG_ON)
61 + enable_history_list = 1;
62 bash_history_enable ();
63 if (history_lines_this_session == 0)
68 ! bash_history_disable ();
69 ! return (1 - remember_on_history);
76 ! enable_history_list = 0;
77 ! bash_history_disable ();
79 ! return (1 - enable_history_list);
86 ! remember_on_history = 1;
92 ! remember_on_history = enable_history_list = 1;
95 *** ../bash-3.2-patched/builtins/evalstring.c 2006-07-28 15:12:16.000000000 -0400
96 --- builtins/evalstring.c 2008-11-10 21:17:16.000000000 -0500
100 static int cat_file __P((REDIRECT *));
102 + #if defined (HISTORY)
104 + set_history_remembering ()
106 + remember_on_history = enable_history_list;
110 /* How to force parse_and_execute () to clean up after itself. */
115 #if defined (HISTORY)
116 ! unwind_protect_int (remember_on_history); /* can be used in scripts */
117 # if defined (BANG_HISTORY)
118 if (interactive_shell)
121 #if defined (HISTORY)
122 ! if (parse_and_execute_level == 0)
123 ! add_unwind_protect (set_history_remembering, (char *)NULL);
125 ! unwind_protect_int (remember_on_history); /* can be used in scripts */
126 # if defined (BANG_HISTORY)
127 if (interactive_shell)
128 *** ../bash-3.2-patched/bashhist.h 2005-07-01 15:44:41.000000000 -0400
129 --- bashhist.h 2008-08-17 12:51:07.000000000 -0400
134 extern int remember_on_history;
135 + extern int enable_history_list; /* value for `set -o history' */
136 + extern int literal_history; /* controlled by `shopt lithist' */
137 + extern int force_append_history;
138 extern int history_lines_this_session;
139 extern int history_lines_in_file;
140 *** ../bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
141 --- patchlevel.h Mon Oct 16 14:22:54 2006
144 looks for to find the patch level (for the sccs version string). */
146 ! #define PATCHLEVEL 40
148 #endif /* _PATCHLEVEL_H_ */
150 looks for to find the patch level (for the sccs version string). */
152 ! #define PATCHLEVEL 41
154 #endif /* _PATCHLEVEL_H_ */