bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash crashes if you try to mapfile into an associative array


From: Chet Ramey
Subject: Re: Bash crashes if you try to mapfile into an associative array
Date: Fri, 16 Oct 2009 12:19:51 -0400
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Nick Hobson wrote:
> From: Nick Hobson
> To: address@hidden
> Subject: Bash crashes if you try to mapfile into an associative array
> 
> 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' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
> -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -march=i686 -mtune=generic 
> -O2 -pipe
> uname output: Linux localhost 2.6.31-ARCH #1 SMP PREEMPT Tue Oct 13 13:36:23 
> CEST 2009 i686 Intel(R) Celeron(R) CPU 550 @ 2.00GHz GenuineIntel GNU/Linux
> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 4.0
> Patch Level: 33
> Release Status: release
> 
> Description:
>     If you declare an array to be associative and then try to mapfile (or 
> readarray) into it, Bash crashes.
> 

That's an incorrect use of `mapfile' -- mapfile takes an indexed array --
but the shell still shouldn't crash by assuming the variable is an
indexed array.  I'll fix that for bash-4.1.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]