commit bash-20200914 snapshot

This commit is contained in:
Chet Ramey
2020-09-21 08:52:52 -04:00
parent 9c10def123
commit a56608bc3f
6 changed files with 90 additions and 9 deletions
+30
View File
@@ -8999,3 +8999,33 @@ variables.c
aclocal.m4
- BASH_STRUCT_WEXITSTATUS_OFFSET: fix typo in loop condition reported
by Andreas K. Hüttel <dilfridge@gentoo.org>
syntax.h
- slashify_in_here_document: restore previous value that doesn't
include double quote, since it's only special in certain cases
subst.c
- expand_word_internal: when processing backslash-double quote inside
a ${...} construct inside a here documemt, treat it the same as if
it were double-quoted, as posix says. Fixes report from
Andreas Schwab <schwab@linux-m68k.org>
9/15
----
support/signames.c
- added a number of more esoteric signal names from AIX and Solaris
parse.y
- report_syntax_error: make sure that the exit status is only set to
one of the special builtin exit statuses if we are really executing
a builtin here, not just if parse_and_execute_level > 0. Reported by
Rob Landley <rob@landley.net>
execute_cmd.c
- EX_BADSYNTAX: make sure that gets translated into EX_BADUSAGE (2)
- execute_simple_command: if a function returns a value greater than
EX_SHERRBASE, use builtin_status to translate it, as if a builtin
were being executed
- builtin_status: make sure a status > EX_SHERRBASE gets translated to
EXECUTION_FAILURE
+4 -3
View File
@@ -4636,7 +4636,7 @@ run_builtin:
if (result == EX_USAGE)
result = EX_BADUSAGE;
else if (result > EX_SHERRBASE)
result = EXECUTION_FAILURE;
result = builtin_status (result);
}
set_pipestatus_from_exit (result);
@@ -4694,16 +4694,17 @@ builtin_status (result)
switch (result)
{
case EX_USAGE:
case EX_BADSYNTAX:
r = EX_BADUSAGE;
break;
case EX_REDIRFAIL:
case EX_BADSYNTAX:
case EX_BADASSIGN:
case EX_EXPFAIL:
r = EXECUTION_FAILURE;
break;
default:
r = EXECUTION_SUCCESS;
/* other special exit statuses not yet defined */
r = (result > EX_SHERRBASE) ? EXECUTION_FAILURE : EXECUTION_SUCCESS;
break;
}
return (r);
+3 -3
View File
@@ -6316,7 +6316,7 @@ report_syntax_error (message)
parser_error (line_number, "%s", message);
if (interactive && EOF_Reached)
EOF_Reached = 0;
last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE;
last_command_exit_value = (executing_builtin && parse_and_execute_level) ? EX_BADSYNTAX : EX_BADUSAGE;
set_pipestatus_from_exit (last_command_exit_value);
return;
}
@@ -6338,7 +6338,7 @@ report_syntax_error (message)
if (interactive == 0)
print_offending_line ();
last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE;
last_command_exit_value = (executing_builtin && parse_and_execute_level) ? EX_BADSYNTAX : EX_BADUSAGE;
set_pipestatus_from_exit (last_command_exit_value);
return;
}
@@ -6370,7 +6370,7 @@ report_syntax_error (message)
EOF_Reached = 0;
}
last_command_exit_value = parse_and_execute_level ? EX_BADSYNTAX : EX_BADUSAGE;
last_command_exit_value = (executing_builtin && parse_and_execute_level) ? EX_BADSYNTAX : EX_BADUSAGE;
set_pipestatus_from_exit (last_command_exit_value);
}
+6 -1
View File
@@ -10383,7 +10383,12 @@ add_string:
c = string[++sindex];
if (quoted & Q_HERE_DOCUMENT)
/* "However, the double-quote character ( '"' ) shall not be treated
specially within a here-document, except when the double-quote
appears within "$()", "``", or "${}"." */
if ((quoted & Q_HERE_DOCUMENT) && (quoted & Q_DOLBRACE) && c == '"')
tflag = CBSDQUOTE; /* special case */
else if (quoted & Q_HERE_DOCUMENT)
tflag = CBSHDOC;
else if (quoted & Q_DOUBLE_QUOTES)
tflag = CBSDQUOTE;
+46 -1
View File
@@ -1,6 +1,6 @@
/* signames.c -- Create an array of signal names. */
/* Copyright (C) 2006 Free Software Foundation, Inc.
/* Copyright (C) 2006-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -159,10 +159,18 @@ initialize_signames ()
signal_names[SIGPRE] = "SIGPRE";
#endif
#if defined (SIGPHONE) /* Phone interrupt */
signal_names[SIGPHONE] = "SIGPHONE";
#endif
#if defined (SIGVIRT) /* AIX virtual time alarm */
signal_names[SIGVIRT] = "SIGVIRT";
#endif
#if defined (SIGTINT) /* Interrupt */
signal_names[SIGTINT] = "SIGTINT";
#endif
#if defined (SIGALRM1) /* m:n condition variables */
signal_names[SIGALRM1] = "SIGALRM1";
#endif
@@ -191,6 +199,18 @@ initialize_signames ()
signal_names[SIGSAK] = "SIGSAK";
#endif
#if defined (SIGCPUFAIL) /* Predictive processor deconfiguration */
signal_names[SIGCPUFAIL] = "SIGCPUFAIL";
#endif
#if defined (SIGAIO) /* Asynchronous I/O */
signal_names[SIGAIO] = "SIGAIO";
#endif
#if defined (SIGLAB) /* Security label changed */
signal_names[SIGLAB] = "SIGLAB";
#endif
/* SunOS5 */
#if defined (SIGLWP) /* Solaris: special signal used by thread library */
signal_names[SIGLWP] = "SIGLWP";
@@ -220,6 +240,31 @@ initialize_signames ()
signal_names[SIGJVM2] = "SIGJVM2";
#endif
#if defined (SIGDGTIMER1)
signal_names[SIGDGTIMER1] = "SIGDGTIMER1";
#endif
#if defined (SIGDGTIMER2)
signal_names[SIGDGTIMER2] = "SIGDGTIMER2";
#endif
#if defined (SIGDGTIMER3)
signal_names[SIGDGTIMER3] = "SIGDGTIMER3";
#endif
#if defined (SIGDGTIMER4)
signal_names[SIGDGTIMER4] = "SIGDGTIMER4";
#endif
#if defined (SIGDGNOTIFY)
signal_names[SIGDGNOTIFY] = "SIGDGNOTIFY";
#endif
/* Apollo */
#if defined (SIGAPOLLO)
signal_names[SIGAPOLLO] = "SIGAPOLLO";
#endif
/* HP-UX */
#if defined (SIGDIL) /* DIL signal (?) */
signal_names[SIGDIL] = "SIGDIL";
+1 -1
View File
@@ -24,7 +24,7 @@
/* Defines for use by mksyntax.c */
#define slashify_in_quotes "\\`$\"\n"
#define slashify_in_here_document "\\`$\""
#define slashify_in_here_document "\\`$"
#define shell_meta_chars "()<>;&|"
#define shell_break_chars "()<>;&| \t\n"