mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-30 17:09:50 +02:00
commit bash-20050929 snapshot
This commit is contained in:
@@ -71,6 +71,18 @@ v. Fixed a bug that caused core dumps when interrupting loops running builtins
|
||||
w. Make sure that some of the functions bash provides replacements for are
|
||||
not cpp defines.
|
||||
|
||||
x. The code that scans embedded commands for the parser (`...` and $(...)) is
|
||||
now more aware of embedded comments and their effect on quoted strings.
|
||||
|
||||
y. Changed the `-n' option to the `history' builtin to not reset the number of
|
||||
history lines read in the current session after reading the new lines from
|
||||
the history file if the history is being appended when it is written to
|
||||
the file, since the appending takes care of the problem that the adjustment
|
||||
was intended to solve.
|
||||
|
||||
z. Improved the error message displayed when a shell script fails to execute
|
||||
because the environment and size of command line arguments is too large.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
a. The `change-case' command now correctly changes the case of multibyte
|
||||
@@ -88,6 +100,9 @@ d. Fixed the non-incremental search code in vi mode to dispose of any current
|
||||
|
||||
e. The variable assignment code now ignores whitespace at the end of lines.
|
||||
|
||||
f. The `C-w' binding in incremental search now understands multibyte
|
||||
characters.
|
||||
|
||||
3. New Features in Bash
|
||||
|
||||
a. A new configuration option, `--enable-strict-posix-default', which will
|
||||
|
||||
@@ -12152,3 +12152,17 @@ lib/readline/rlmbutil.h
|
||||
|
||||
lib/readline/text.c
|
||||
- use _rl_to_wupper and _rl_to_wlower as appropriate
|
||||
|
||||
9/26
|
||||
----
|
||||
execute_cmd.c
|
||||
- in shell_execve, if the exec fails due to E2BIG or ENOMEM, just print
|
||||
the appropriate error message instead of checking out any interpreter
|
||||
specified with #!
|
||||
|
||||
9/30
|
||||
----
|
||||
bashhist.c
|
||||
- make $HISTCMD available anytime remember_on_history is non-zero,
|
||||
which indicates that we're saving commands to the history, and
|
||||
let it evaluate to 1 if we're not
|
||||
|
||||
@@ -12146,3 +12146,16 @@ builtins/history.def
|
||||
|
||||
lib/readline/isearch.c
|
||||
- fix C-w handler for isearch string reader to handle multibyte chars
|
||||
|
||||
lib/readline/rlmbutil.h
|
||||
- new defines for _rl_to_wupper and _rl_to_wlower
|
||||
|
||||
lib/readline/text.c
|
||||
- use _rl_to_wupper and _rl_to_wlower as appropriate
|
||||
|
||||
9/26
|
||||
----
|
||||
execute_cmd.c
|
||||
- in shell_execve, if the exec fails due to E2BIG or ENOMEM, just print
|
||||
the appropriate error message instead of checking out any interpreter
|
||||
specified with #!
|
||||
|
||||
+1
-1
@@ -713,7 +713,7 @@ int
|
||||
history_number ()
|
||||
{
|
||||
using_history ();
|
||||
return (get_string_value ("HISTSIZE") ? history_base + where_history () : 1);
|
||||
return (remember_on_history ? history_base + where_history () : 1);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -156,6 +156,10 @@ int history_control;
|
||||
to a previous entry as part of command-oriented-history processing. */
|
||||
int hist_last_line_added;
|
||||
|
||||
/* Set to 1 if builtins/history.def:push_history added the last history
|
||||
entry. */
|
||||
int hist_last_line_pushed;
|
||||
|
||||
#if defined (READLINE)
|
||||
/* If non-zero, and readline is being used, the user is offered the
|
||||
chance to re-edit a failed history expansion. */
|
||||
@@ -700,6 +704,7 @@ really_add_history (line)
|
||||
char *line;
|
||||
{
|
||||
hist_last_line_added = 1;
|
||||
hist_last_line_pushed = 0;
|
||||
add_history (line);
|
||||
history_lines_this_session++;
|
||||
}
|
||||
|
||||
@@ -3855,6 +3855,12 @@ shell_execve (command, args, env)
|
||||
errno = i;
|
||||
file_error (command);
|
||||
}
|
||||
/* errors not involving the path argument to execve. */
|
||||
else if (i == E2BIG || i == ENOMEM)
|
||||
{
|
||||
errno = i;
|
||||
file_error (command);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The file has the execute bits set, but the kernel refuses to
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* Another test harness for the readline callback interface.
|
||||
*
|
||||
* Author: Bob Rossi <bob@brasko.net>
|
||||
*/
|
||||
|
||||
#if defined (HAVE_CONFIG_H)
|
||||
#include <config.h>
|
||||
#endif
|
||||
@@ -229,7 +236,21 @@ int tty_cbreak(int fd){
|
||||
buf.c_cc[VDSUSP] = _POSIX_VDISABLE;
|
||||
#endif
|
||||
|
||||
if(tcsetattr(fd, TCSAFLUSH, &buf) < 0)
|
||||
/* enable flow control; only stty start char can restart output */
|
||||
#if 0
|
||||
buf.c_iflag |= (IXON|IXOFF);
|
||||
#ifdef IXANY
|
||||
buf.c_iflag &= ~IXANY;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* disable flow control; let ^S and ^Q through to pty */
|
||||
buf.c_iflag &= ~(IXON|IXOFF);
|
||||
#ifdef IXANY
|
||||
buf.c_iflag &= ~IXANY;
|
||||
#endif
|
||||
|
||||
if(tcsetattr(fd, TCSAFLUSH, &buf) < 0)
|
||||
return -1;
|
||||
|
||||
ttystate = TCBREAK;
|
||||
@@ -246,6 +267,23 @@ int tty_cbreak(int fd){
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
tty_off_xon_xoff (int fd)
|
||||
{
|
||||
struct termios buf;
|
||||
int ttysavefd = -1;
|
||||
|
||||
if(tcgetattr(fd, &buf) < 0)
|
||||
return -1;
|
||||
|
||||
buf.c_iflag &= ~(IXON|IXOFF);
|
||||
|
||||
if(tcsetattr(fd, TCSAFLUSH, &buf) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* tty_reset: Sets the terminal attributes back to their previous state.
|
||||
* PRE: tty_cbreak must have already been called.
|
||||
*
|
||||
@@ -253,7 +291,8 @@ int tty_cbreak(int fd){
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int tty_reset(int fd){
|
||||
int tty_reset(int fd)
|
||||
{
|
||||
if(ttystate != TCBREAK)
|
||||
return (0);
|
||||
|
||||
@@ -273,6 +312,10 @@ main()
|
||||
if (val == -1)
|
||||
return -1;
|
||||
|
||||
val = tty_off_xon_xoff (masterfd);
|
||||
if (val == -1)
|
||||
return -1;
|
||||
|
||||
val = init_readline (slavefd, slavefd);
|
||||
if (val == -1)
|
||||
return -1;
|
||||
|
||||
@@ -413,10 +413,14 @@ sighandler
|
||||
termination_unwind_protect (sig)
|
||||
int sig;
|
||||
{
|
||||
/* I don't believe this condition ever tests true. */
|
||||
if (sig == SIGINT && signal_is_trapped (SIGINT))
|
||||
run_interrupt_trap ();
|
||||
|
||||
#if defined (HISTORY)
|
||||
/* This might be unsafe, since it eventually calls functions POSIX says
|
||||
not to call from signal handlers. If it's a problem, take this code
|
||||
out. */
|
||||
if (interactive_shell && sig != SIGABRT)
|
||||
maybe_save_shell_history ();
|
||||
#endif /* HISTORY */
|
||||
|
||||
Reference in New Issue
Block a user