mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 15:43:18 +02:00
commit bash-20130816 snapshot
This commit is contained in:
@@ -5166,3 +5166,11 @@ builtins/help.def
|
||||
versions. This prevents `help read' from matching both `read' and
|
||||
`readonly', but allows `help r' to match everything beginning with
|
||||
`r'. Inspired by report from Geir Hauge <geir.hauge@gmail.com>
|
||||
|
||||
8/13
|
||||
----
|
||||
builtins/fc.def
|
||||
- fc_builtin,fc_gethnum: calculate `real' end of the history list and
|
||||
use it if -0 is specified as the beginning or end of the history
|
||||
range to list. Doesn't work for fc -e or fc -s by design. Feature
|
||||
requested by Mike Fied <micfied@gmail.com>
|
||||
|
||||
+12
-2
@@ -173,7 +173,7 @@ fc_builtin (list)
|
||||
register int i;
|
||||
register char *sep;
|
||||
int numbering, reverse, listing, execute;
|
||||
int histbeg, histend, last_hist, retval, opt, rh;
|
||||
int histbeg, histend, last_hist, retval, opt, rh, real_last;
|
||||
FILE *stream;
|
||||
REPL *rlist, *rl;
|
||||
char *ename, *command, *newcom, *fcedit;
|
||||
@@ -303,6 +303,14 @@ fc_builtin (list)
|
||||
rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
|
||||
last_hist = i - rh - hist_last_line_added;
|
||||
|
||||
/* Make sure that real_last is calculated the same way here and in
|
||||
fc_gethnum. The return value from fc_gethnum is treated specially if
|
||||
it is == real_last and we are listing commands. */
|
||||
real_last = i;
|
||||
/* back up from the end to the last non-null history entry */
|
||||
while (hlist[real_last] == 0 && real_last > 0)
|
||||
real_last--;
|
||||
|
||||
/* XXX */
|
||||
if (i == last_hist && hlist[last_hist] == 0)
|
||||
while (last_hist >= 0 && hlist[last_hist] == 0)
|
||||
@@ -320,6 +328,8 @@ fc_builtin (list)
|
||||
|
||||
if (list)
|
||||
histend = fc_gethnum (list->word->word, hlist);
|
||||
else if (histbeg == real_last)
|
||||
histend = listing ? real_last : histbeg;
|
||||
else
|
||||
histend = listing ? last_hist : histbeg;
|
||||
}
|
||||
@@ -538,7 +548,7 @@ fc_gethnum (command, hlist)
|
||||
return (n < 0 ? 0 : n);
|
||||
}
|
||||
else if (n == 0)
|
||||
return (i);
|
||||
return ((sign == -1) ? real_last : i);
|
||||
else
|
||||
{
|
||||
n -= history_base;
|
||||
|
||||
+172
-160
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+195
-181
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+181
-167
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+172
-161
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+175
-161
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+172
-161
File diff suppressed because it is too large
Load Diff
@@ -58,5 +58,8 @@ if [ -n "$sflag" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$dflag" ]; then
|
||||
if [ ! -d $HOME/Dropbox ]; then
|
||||
HOME=~chet
|
||||
fi
|
||||
cp ${TARF}.gz $HOME/Dropbox/
|
||||
fi
|
||||
|
||||
@@ -277,8 +277,9 @@ void
|
||||
run_pending_traps ()
|
||||
{
|
||||
register int sig;
|
||||
int old_exit_value, *token_state;
|
||||
int old_exit_value;
|
||||
WORD_LIST *save_subst_varlist;
|
||||
sh_parser_state_t pstate;
|
||||
#if defined (ARRAY_VARS)
|
||||
ARRAY *ps;
|
||||
#endif
|
||||
@@ -362,7 +363,7 @@ run_pending_traps ()
|
||||
else
|
||||
{
|
||||
/* XXX - should we use save_parser_state/restore_parser_state? */
|
||||
token_state = save_token_state ();
|
||||
save_parser_state (&pstate);
|
||||
save_subst_varlist = subst_assign_varlist;
|
||||
subst_assign_varlist = 0;
|
||||
|
||||
@@ -374,8 +375,7 @@ run_pending_traps ()
|
||||
restore_pipeline (1);
|
||||
#endif
|
||||
|
||||
restore_token_state (token_state);
|
||||
free (token_state);
|
||||
restore_parser_state (&pstate);
|
||||
|
||||
subst_assign_varlist = save_subst_varlist;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user