1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

add three fixes from bug-bash@:

- pipefail option
- broken array expansion
- segmentation fault in unset typeset array variable
This commit is contained in:
Oliver Eikemeier 2004-08-19 09:15:47 +00:00
parent 2ba3bd8f1c
commit 0ddba63255
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=116655
4 changed files with 57 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= bash
PORTVERSION= 3.0
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= shells
MASTER_SITES= ${MASTER_SITE_GNU} \
ftp://ftp.cwru.edu/pub/%SUBDIR%/

View File

@ -0,0 +1,21 @@
#
# Fix pipefail option
#
# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00215.html
#
--- jobs.c.orig Fri Apr 23 21:28:25 2004
+++ jobs.c Wed Aug 18 14:32:19 2004
@@ -1778,8 +1778,11 @@
if (pipefail_opt)
{
fail = 0;
- for (p = jobs[job]->pipe; p->next != jobs[job]->pipe; p = p->next)
- if (p->status != EXECUTION_SUCCESS) fail = p->status;
+ p = jobs[job]->pipe;
+ do {
+ if (p->status != EXECUTION_SUCCESS) fail = p->status;
+ p=p->next;
+ } while(p!=jobs[job]->pipe);
return fail;
}

View File

@ -0,0 +1,16 @@
#
# Fix broken array expansion
#
# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00192.html
#
--- subst.c.orig Sun Jul 4 13:56:13 2004
+++ subst.c Thu Aug 12 13:36:17 2004
@@ -4891,7 +4891,7 @@
if (*e1p < 0) /* negative offsets count from end */
*e1p += len;
- if (*e1p >= len || *e1p < 0)
+ if (*e1p > len || *e1p < 0)
return (-1);
#if defined (ARRAY_VARS)

View File

@ -0,0 +1,19 @@
#
# Fix segmentation fault in unset typeset array variable
#
# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00190.html
#
--- variables.c.orig Sun Jul 4 13:57:26 2004
+++ variables.c Wed Aug 4 15:28:04 2004
@@ -1599,7 +1599,10 @@
/* local foo; local foo; is a no-op. */
old_var = find_variable (name);
if (old_var && local_p (old_var) && old_var->context == variable_context)
- return (old_var);
+ {
+ VUNSETATTR (old_var, att_invisible);
+ return (old_var);
+ }
was_tmpvar = old_var && tempvar_p (old_var);
if (was_tmpvar)