From 0ddba632558c994d9478e98dafc3b432c0064a7b Mon Sep 17 00:00:00 2001 From: Oliver Eikemeier Date: Thu, 19 Aug 2004 09:15:47 +0000 Subject: add three fixes from bug-bash@: - pipefail option - broken array expansion - segmentation fault in unset typeset array variable --- shells/bash/files/patch-jobs.c | 21 +++++++++++++++++++++ shells/bash/files/patch-subst.c | 16 ++++++++++++++++ shells/bash/files/patch-variables.c | 19 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 shells/bash/files/patch-jobs.c create mode 100644 shells/bash/files/patch-subst.c create mode 100644 shells/bash/files/patch-variables.c (limited to 'shells/bash/files') diff --git a/shells/bash/files/patch-jobs.c b/shells/bash/files/patch-jobs.c new file mode 100644 index 000000000000..4e5db16b983a --- /dev/null +++ b/shells/bash/files/patch-jobs.c @@ -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; + } + diff --git a/shells/bash/files/patch-subst.c b/shells/bash/files/patch-subst.c new file mode 100644 index 000000000000..d7687e24301a --- /dev/null +++ b/shells/bash/files/patch-subst.c @@ -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) diff --git a/shells/bash/files/patch-variables.c b/shells/bash/files/patch-variables.c new file mode 100644 index 000000000000..ac4bb07c3e37 --- /dev/null +++ b/shells/bash/files/patch-variables.c @@ -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) -- cgit v1.2.3