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
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
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
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 #!
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
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. */
char *line;
{
hist_last_line_added = 1;
+ hist_last_line_pushed = 0;
add_history (line);
history_lines_this_session++;
}
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
+/*
+ *
+ * Another test harness for the readline callback interface.
+ *
+ * Author: Bob Rossi <bob@brasko.net>
+ */
+
#if defined (HAVE_CONFIG_H)
#include <config.h>
#endif
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;
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.
*
*
* Returns: 0 on success, -1 on error
*/
-int tty_reset(int fd){
+int tty_reset(int fd)
+{
if(ttystate != TCBREAK)
return (0);
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;
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 */