From 45cccbbc0e696f9c9d2dd644cf38b4533fc8d0f8 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Mon, 2 Oct 2017 16:42:47 -0400 Subject: [PATCH] commit bash-20170929 snapshot --- CWRU/CWRU.chlog | 19 +++++++++++++++++++ builtins/read.def | 2 ++ configure | 4 ++-- configure.ac | 4 ++-- jobs.h | 1 - parse.y | 6 +++++- subst.h | 2 ++ variables.c | 4 ++++ 8 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index e7819bb2..3a058061 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -14309,3 +14309,22 @@ builtins/printf.def valid multibyte character; use mbtowc right away and then inspect the return value. Fixes bug reported by Stephane Chazelas + + 9/27 + ---- +{jobs,subst}.h + - move declaration of last_command_subst_pid to subst.h, since it's + declared in subst.c and doesn't depend on job control. Reported by + Martijn Dekker + +builtins/read.def,variables.c + - fixed a couple of problems (READLINE, ARRAY_VARS) that prevented + the minimal config from building + + 10/1 + ---- +parse.y + - special_case_tokens: if we are returning DO in a case where the last + two tokens read are `FOR' and `WORD' make sure we decrement + expecting_in_token. Fixes bug reported by Martijn Dekker + diff --git a/builtins/read.def b/builtins/read.def index da9ac2a0..f769c5b0 100644 --- a/builtins/read.def +++ b/builtins/read.def @@ -686,6 +686,7 @@ add_char: input_string[i] = '\0'; /* for simplicity and debugging */ /* If we got input from readline, grab the next multibyte char from rlbuf. */ +# if defined (READLINE) if (edit) { size_t clen; @@ -701,6 +702,7 @@ add_char: } } else +# endif i += read_mbchar (fd, input_string, i, c, unbuffered_read); } #endif diff --git a/configure b/configure index f8a8c2f6..18b2ae77 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac for Bash 4.4, version 4.088. +# From configure.ac for Bash 4.4, version 4.089. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for bash 4.4-maint. # @@ -10284,7 +10284,7 @@ else int main () { -int main() { long double r; char *foo, bar; r = strtold(foo, &bar);} +long double r; char *foo, bar; r = strtold(foo, &bar); ; return 0; } diff --git a/configure.ac b/configure.ac index 40394192..578871cd 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script. # You should have received a copy of the GNU General Public License # along with this program. If not, see . -AC_REVISION([for Bash 4.4, version 4.088])dnl +AC_REVISION([for Bash 4.4, version 4.089])dnl define(bashvers, 4.4) define(relstatus, maint) @@ -817,7 +817,7 @@ AC_CHECK_DECLS([strtold], [ AC_CACHE_VAL(bash_cv_strtold_broken, [AC_TRY_COMPILE( [#include ], - [int main() { long double r; char *foo, bar; r = strtold(foo, &bar);}], + [long double r; char *foo, bar; r = strtold(foo, &bar);], bash_cv_strtold_broken=no, bash_cv_strtold_broken=yes, [AC_MSG_WARN(cannot check for broken strtold if cross-compiling, defaulting to no)]) ] diff --git a/jobs.h b/jobs.h index 5c918abc..4eca6260 100644 --- a/jobs.h +++ b/jobs.h @@ -187,7 +187,6 @@ extern struct jobstats js; extern pid_t original_pgrp, shell_pgrp, pipeline_pgrp; extern volatile pid_t last_made_pid, last_asynchronous_pid; -extern pid_t last_command_subst_pid; extern int asynchronous_notification; extern int already_making_children; diff --git a/parse.y b/parse.y index 92da96b9..623648c6 100644 --- a/parse.y +++ b/parse.y @@ -2996,7 +2996,11 @@ special_case_tokens (tokstr) (token_before_that == FOR) && #endif (tokstr[0] == 'd' && tokstr[1] == 'o' && tokstr[2] == '\0')) - return (DO); + { + if (expecting_in_token) + expecting_in_token--; + return (DO); + } /* Ditto for ESAC in the CASE case. Specifically, this handles "case word in esac", which is a legal diff --git a/subst.h b/subst.h index 578bd11d..f1f1ccd9 100644 --- a/subst.h +++ b/subst.h @@ -329,6 +329,8 @@ extern int assigning_in_environment; extern int expanding_redir; extern int inherit_errexit; +extern pid_t last_command_subst_pid; + /* Evaluates to 1 if C is a character in $IFS. */ #define isifs(c) (ifs_cmap[(unsigned char)(c)] != 0) diff --git a/variables.c b/variables.c index a08313d7..495ebbf2 100644 --- a/variables.c +++ b/variables.c @@ -2534,11 +2534,15 @@ make_local_variable (name, flags) { /* This may not make sense for nameref variables that are shadowing variables with the same name, but we don't know that yet. */ +#if defined (ARRAY_VARS) if (assoc_p (old_var)) var_setassoc (new_var, assoc_copy (assoc_cell (old_var))); else if (array_p (old_var)) var_setarray (new_var, array_copy (array_cell (old_var))); else if (value_cell (old_var)) +#else + if (value_cell (old_var)) +#endif var_setvalue (new_var, savestring (value_cell (old_var))); else var_setvalue (new_var, (char *)NULL);