diff options
Diffstat (limited to 'shells/bash/files/patch-subst.c')
-rw-r--r-- | shells/bash/files/patch-subst.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/shells/bash/files/patch-subst.c b/shells/bash/files/patch-subst.c index d7687e24301a..b55b2f5fa123 100644 --- a/shells/bash/files/patch-subst.c +++ b/shells/bash/files/patch-subst.c @@ -1,16 +1,16 @@ # # Fix broken array expansion # -# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00192.html +# http://lists.gnu.org/archive/html/bug-bash/2004-09/msg00097.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) +--- subst.c.orig Thu Aug 12 13:36:17 2004 ++++ subst.c Thu Sep 9 11:54:22 2004 +@@ -4900,7 +4900,7 @@ + case VT_ARRAYVAR: + a = (ARRAY *)value; + /* For arrays, the first value deals with array indices. */ +- len = array_max_index (a); /* arrays index from 0 to n - 1 */ ++ len = array_max_index (a) + 1; /* arrays index from 0 to n - 1 */ + break; + #endif + } |