[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash 3 breaks array expansion
From: |
Chet Ramey |
Subject: |
Re: Bash 3 breaks array expansion |
Date: |
Mon, 16 Aug 2004 16:57:00 -0400 |
> Configuration Information [Automatically generated, do not change]:
> Machine: i686
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -$uname
> output: Linux uberlaptop 2.6.7 #2 Sun Jul 18 12:00:59 BST 2004 i686
> Mobile Intel(R) Celeron(R) CPU 1.60GHz GenuineInte$Machine Type:
> i686-pc-linux-gnu
>
> Bash Version: 3.0
> Patch Level: 0
> Release Status: release
>
> Description:
> Bash 3 breaks array expansion
>
> Repeat-By:
> #!/bin/bash
> x=(one two)
> echo ${x[@]:1}
> # prints nothing in bash 3
> # prints two in bash 2
Try this:
*** ../bash-3.0/subst.c Sun Jul 4 13:56:13 2004
--- subst.c Thu Aug 12 13:36:17 2004
***************
*** 4892,4896 ****
*e1p += len;
! if (*e1p >= len || *e1p < 0)
return (-1);
--- 4912,4916 ----
*e1p += len;
! if (*e1p > len || *e1p < 0)
return (-1);
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/