diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 7ce788cb..7691d495 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -10420,3 +10420,40 @@ bashhist.c - bash_history_inhibit_expansion: function should be compiled in only if BANG_HISTORY is defined. Report from isabella parakiss + +[bash-4.4-rc1 frozen] + + 2/15 + ---- +lib/readline/text.c + - rl_refresh_line: call rl_redraw_prompt_last_line instead of + rl_forced_update_display to avoid redrawing all lines of a multiline + prompt (overwriting the last line of the multiline prompt in the + process). Report from Hugh Davenport + + 2/18 + ---- +subst.c + - parameter_brace_expand: when processing ${!name[@]}, make sure to + free `name' before returning the list of keys to avoid a memory leak. + Fixes bug reported by Emilio PastorMira + + 2/19 + ---- +trap.c + - free_trap_strings: when freeing the `special' traps (NSIG to BASH_NSIG), + check whether or not the `signal' is trapped, as it would be if the + subshell inherited it (errtrace) and don't free the trap string in that + case. Fixes bug reported by Jan Klötzke + + 2/21 + ---- +lib/sh/netconn.c + - isnetconn: return false if getpeername fails with errno == EBADF. + Bug and fix from Andrew Gregory + +builtins/shopt.def + - parse_bashopts: when reading BASHOPTS from the environment, make + sure to call any set functions associated with a variable, instead + of just setting the value to 1. Report and fix from + Vehlow, Jörg diff --git a/builtins/shopt.def b/builtins/shopt.def index f371ac88..c4a75ea5 100644 --- a/builtins/shopt.def +++ b/builtins/shopt.def @@ -768,7 +768,11 @@ parse_bashopts (value) { ind = find_shopt (vname); if (ind >= 0) - *shopt_vars[ind].value = 1; + { + *shopt_vars[ind].value = 1; + if (shopt_vars[ind].set_func) + (*shopt_vars[ind].set_func) (shopt_vars[ind].name, 1); + } free (vname); } } diff --git a/doc/bashbug.1 b/doc/bashbug.1 index 962cb9cb..61d9122a 100644 --- a/doc/bashbug.1 +++ b/doc/bashbug.1 @@ -5,9 +5,9 @@ .\" Case Western Reserve University .\" chet@po.cwru.edu .\" -.\" Last Change: Tue Apr 3 15:46:30 EDT 2007 +.\" Last Change: Mon Feb 15 14:42:40 EST 2016 .\" -.TH BASHBUG 1 "1998 July 30" "GNU Bash-4.0" +.TH BASHBUG 1 "2016 February 15" "GNU Bash-4.4" .SH NAME bashbug \- report a bug in bash .SH SYNOPSIS @@ -43,8 +43,9 @@ Specifies the preferred editor. If .B EDITOR is not set, .B bashbug -defaults to -.BR emacs . +attempts to locate a number of alternative editors, including +.BR emacs , +and defaults to \fBvi\fP. .TP .B HOME Directory in which the failed bug report is saved if the mail fails. diff --git a/lib/readline/text.c b/lib/readline/text.c index d54499dc..c353252b 100644 --- a/lib/readline/text.c +++ b/lib/readline/text.c @@ -572,7 +572,7 @@ rl_refresh_line (ignore1, ignore2) _rl_clear_to_eol (0); /* arg of 0 means to not use spaces */ - rl_forced_update_display (); + rl_redraw_prompt_last_line (); rl_display_fixed = 1; return 0; diff --git a/lib/sh/netconn.c b/lib/sh/netconn.c index 36e5bf5c..f4ffe6c7 100644 --- a/lib/sh/netconn.c +++ b/lib/sh/netconn.c @@ -52,7 +52,7 @@ isnetconn (fd) l = sizeof(sa); rv = getpeername(fd, &sa, &l); /* Posix.2 says getpeername can return these errors. */ - return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL)) ? 0 : 1); + return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL || errno == EBADF)) ? 0 : 1); #else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ # if defined (SVR4) || defined (SVR4_2) /* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */ diff --git a/subst.c b/subst.c index 833acf99..272b913d 100644 --- a/subst.c +++ b/subst.c @@ -8040,6 +8040,7 @@ parameter_brace_expand (string, indexp, quoted, pflags, quoted_dollar_atp, conta tflag |= W_DOLLARAT; } + free (name); free (temp1); *indexp = sindex; diff --git a/trap.c b/trap.c index 71726f6a..23ba314a 100644 --- a/trap.c +++ b/trap.c @@ -1144,12 +1144,20 @@ free_trap_strings () { register int i; - for (i = 0; i < BASH_NSIG; i++) + for (i = 0; i < NSIG; i++) { if (trap_list[i] != (char *)IGNORE_SIG) free_trap_string (i); } - trap_list[DEBUG_TRAP] = trap_list[EXIT_TRAP] = trap_list[ERROR_TRAP] = trap_list[RETURN_TRAP] = (char *)NULL; + for (i = NSIG; i < BASH_NSIG; i++) + { + /* Don't free the trap string if the subshell inherited the trap */ + if ((sigmodes[i] & SIG_TRAPPED) == 0) + { + free_trap_string (i); + trap_list[i] = (char *)NULL; + } + } } /* Free a trap command string associated with SIG without changing signal