diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2009-08-26 10:00:38 -0500 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:41:17 +0200 |
commit | 5a12e7c134274dba706667107d10d231517d3e05 (patch) | |
tree | 55718d5acb710fde798d9f38d0bbaf594ed4b296 /testing/source/bash/bash-4.0-patches/bash40-014 | |
download | current-5a12e7c134274dba706667107d10d231517d3e05.tar.gz |
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009
Slackware 13.0 x86_64 is released as stable! Thanks to everyone who
helped make this release possible -- see the RELEASE_NOTES for the
credits. The ISOs are off to the replicator. This time it will be a
6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We're taking pre-orders now at store.slackware.com. Please consider
picking up a copy to help support the project. Once again, thanks to
the entire Slackware community for all the help testing and fixing
things and offering suggestions during this development cycle.
As always, have fun and enjoy! -P.
Diffstat (limited to 'testing/source/bash/bash-4.0-patches/bash40-014')
-rw-r--r-- | testing/source/bash/bash-4.0-patches/bash40-014 | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/testing/source/bash/bash-4.0-patches/bash40-014 b/testing/source/bash/bash-4.0-patches/bash40-014 new file mode 100644 index 00000000..eeba336c --- /dev/null +++ b/testing/source/bash/bash-4.0-patches/bash40-014 @@ -0,0 +1,113 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.0 +Patch-ID: bash40-014 + +Bug-Reported-by: smallnow@gmail.com +Bug-Reference-ID: <49C460FE.40307@gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00166.html + +Bug-Description: + +When the fc builtin is run in a command substitution from a shell with history +enabled, it does not correctly calculate the command on which to operate. + +Patch: + +*** ../bash-4.0-patched/builtins/fc.def 2009-01-04 14:32:22.000000000 -0500 +--- builtins/fc.def 2009-03-21 14:03:43.000000000 -0400 +*************** +*** 89,92 **** +--- 89,93 ---- + extern int literal_history; + extern int posixly_correct; ++ extern int subshell_environment, interactive_shell; + + extern int unlink __P((const char *)); +*************** +*** 173,177 **** + register char *sep; + int numbering, reverse, listing, execute; +! int histbeg, histend, last_hist, retval, opt; + FILE *stream; + REPL *rlist, *rl; +--- 174,178 ---- + register char *sep; + int numbering, reverse, listing, execute; +! int histbeg, histend, last_hist, retval, opt, rh; + FILE *stream; + REPL *rlist, *rl; +*************** +*** 276,279 **** +--- 277,282 ---- + fprintf (stderr, "%s\n", command); + fc_replhist (command); /* replace `fc -s' with command */ ++ /* Posix says that the re-executed commands should be entered into the ++ history. */ + return (parse_and_execute (command, "fc", SEVAL_NOHIST)); + } +*************** +*** 294,298 **** + so we check hist_last_line_added. */ + +! last_hist = i - remember_on_history - hist_last_line_added; + + if (list) +--- 297,306 ---- + so we check hist_last_line_added. */ + +! /* Even though command substitution through parse_and_execute turns off +! remember_on_history, command substitution in a shell when set -o history +! has been enabled (interactive or not) should use it in the last_hist +! calculation as if it were on. */ +! rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); +! last_hist = i - rh - hist_last_line_added; + + if (list) +*************** +*** 457,461 **** + HIST_ENTRY **hlist; + { +! int sign, n, clen; + register int i, j; + register char *s; +--- 465,469 ---- + HIST_ENTRY **hlist; + { +! int sign, n, clen, rh; + register int i, j; + register char *s; +*************** +*** 473,477 **** + so we check hist_last_line_added. This needs to agree with the + calculation of last_hist in fc_builtin above. */ +! i -= remember_on_history + hist_last_line_added; + + /* No specification defaults to most recent command. */ +--- 481,490 ---- + so we check hist_last_line_added. This needs to agree with the + calculation of last_hist in fc_builtin above. */ +! /* Even though command substitution through parse_and_execute turns off +! remember_on_history, command substitution in a shell when set -o history +! has been enabled (interactive or not) should use it in the last_hist +! calculation as if it were on. */ +! rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); +! i -= rh + hist_last_line_added; + + /* No specification defaults to most recent command. */ +*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 +--- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ |