Updates from Koichi Murase <myoga.murase@gmail.com>
- BRACKMATCH: if a range expression is incomplete (no end char),
treat the bracket as an ordinary character
+
+ 11/18
+ -----
+doc/bashref.texi
+ - Reporting Bugs: add mention of the Savannah project page. Suggested
+ by Loïc Yhuel <loic.yhuel@gmail.com>
+
+ 11/20
+ -----
+builtins/common.h
+ - SEVAL_NOOPTIMIZE: new flag for parse_and_execute: means don't try to
+ optimize forks out of any simple or conditional commands
+
+builtins/evalstring.c
+ - parse_and_execute: if FLAGS includes SEVAL_NOOPTIMIZE, don't try to
+ call can_optimize_connection to optimize away forks from AND_AND or
+ OR_OR commands
+
+builtins/eval.def,trap.c,parse.y,jobs.c
+ - parse_and_execute: include SEVAL_NOOPTIMIZE in any calls to
+ parse_and_execute. Fixes bug reported by
+ Frode Nordahl <frode.nordahl@canonical.com>
+
+ 11/21
+ -----
+lib/readline/readline.c
+ - readline_initialize_everything: use xmalloc to initialize
+ rl_executing_keyseq, since we use xrealloc to reallocate it and
+ don't check it for NULL anywhere
#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */
#define SEVAL_ONECMD 0x100 /* only allow a single command */
#define SEVAL_NOHISTEXP 0x200 /* inhibit history expansion */
+#define SEVAL_NOOPTIMIZE 0x400 /* don't try to set optimization flags */
/* Flags for describe_command, shared between type.def and command.def */
#define CDESC_ALL 0x001 /* type -a */
return (EX_USAGE);
list = loptend; /* skip over possible `--' */
- return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST) : EXECUTION_SUCCESS);
+ return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST|SEVAL_NOOPTIMIZE) : EXECUTION_SUCCESS);
}
if (command->type == cm_connection &&
(command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
(command->value.Connection->second->flags & CMD_TRY_OPTIMIZING) &&
- ((startup_state == 2 && should_suppress_fork (command->value.Connection->second)) ||
- ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork (command->value.Connection->second, 0))))
+ (should_suppress_fork (command->value.Connection->second) ||
+ ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork (command->value.Connection->second, 0))))
{
command->value.Connection->second->flags |= CMD_NO_FORK;
command->value.Connection->second->value.Simple->flags |= CMD_NO_FORK;
(flags & SEVAL_NOFREE) -> don't free STRING when finished
(flags & SEVAL_RESETLINE) -> reset line_number to 1
(flags & SEVAL_NOHISTEXP) -> history_expansion_inhibited -> 1
+ (flags & SEVAL_NOOPTIMIZE) -> don't try to turn on optimizing flags
*/
int
if we are at the end of the command string, the last in a
series of connection commands is
command->value.Connection->second. */
- else if (command->type == cm_connection && can_optimize_connection (command))
+ else if (command->type == cm_connection &&
+ (flags & SEVAL_NOOPTIMIZE) == 0 &&
+ can_optimize_connection (command))
{
command->value.Connection->second->flags |= CMD_TRY_OPTIMIZING;
command->value.Connection->second->value.Simple->flags |= CMD_TRY_OPTIMIZING;
In each of the cases below, @var{word} is subject to tilde expansion,
parameter expansion, command substitution, and arithmetic expansion.
-When not performing substring expansion, using the form described
+When not performing substring expansion, using the forms described
below (e.g., @samp{:-}), Bash tests for a parameter that is unset or null.
Omitting the colon results in a test only for a parameter that is unset.
Put another way, if the colon is included,
@uref{http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz}.
Once you have determined that a bug actually exists, use the
-@code{bashbug} command to submit a bug report.
-If you have a fix, you are encouraged to mail that as well!
+@code{bashbug} command to submit a bug report or use the form at the
+<a href="https://savannah.gnu.org/projects/bash/">Bash project page</a>.
+If you have a fix, you are encouraged to submit that as well!
Suggestions and `philosophical' bug reports may be mailed
-to @email{bug-bash@@gnu.org} or posted to the Usenet
-newsgroup @code{gnu.bash.bug}.
+to @email{bug-bash@@gnu.org} or @email{help-bash@gnu.org}.
All bug reports should include:
@itemize @bullet
Copyright (C) 1988-2022 Free Software Foundation, Inc.
@end ignore
-@set LASTCHANGE Mon Sep 19 11:13:51 EDT 2022
+@set LASTCHANGE Fri Nov 18 11:09:41 EST 2022
@set EDITION 5.2
@set VERSION 5.2
-@set UPDATED 19 September 2022
-@set UPDATED-MONTH September 2022
+@set UPDATED 18 November 2022
+@set UPDATED-MONTH November 2022
jobs_list_frozen = 1;
for (i = 0; i < nchild; i++)
{
- parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE);
+ parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
}
run_unwind_frame ("SIGCHLD trap");
_rl_parse_colors ();
#endif
- rl_executing_keyseq = malloc (_rl_executing_keyseq_size = 16);
- if (rl_executing_keyseq)
- rl_executing_keyseq[rl_key_sequence_length = 0] = '\0';
+ rl_executing_keyseq = xmalloc (_rl_executing_keyseq_size = 16);
+ rl_executing_keyseq[rl_key_sequence_length = 0] = '\0';
}
/* If this system allows us to look at the values of the regular
if (last_lastarg)
last_lastarg = savestring (last_lastarg);
- parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST);
+ parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE);
restore_parser_state (&ps);
bind_variable ("_", last_lastarg, 0);
if (function_code == 0)
/* XXX is x always last_command_exit_value? */
- x = parse_and_execute (trap_command, "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
+ x = parse_and_execute (trap_command, "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
else
{
parse_and_execute_cleanup (sig + 1); /* XXX - could use -1 */
if (code == 0 && function_code == 0)
{
reset_parser ();
- parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
+ parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
}
else if (code == ERREXIT)
retval = last_command_exit_value;
function_code = setjmp_nosigs (return_catch);
}
- flags = SEVAL_NONINT|SEVAL_NOHIST;
+ flags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE;
if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP)
flags |= SEVAL_RESETLINE;
if (function_code == 0)