Initialize Tizen 2.3
[external/bash.git] / debian / patches / builtins-declare-fix.dpatch
1 #! /bin/sh -e
2
3 if [ $# -eq 3 -a "$2" = '-d' ]; then
4     pdir="-d $3"
5 elif [ $# -ne 1 ]; then
6     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7     exit 1
8 fi
9 case "$1" in
10     -patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
11     -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
12     *)
13         echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14         exit 1
15 esac
16 exit 0
17
18 # DP: <your description>
19 Andreas Schwab <schwab@linux-m68k.org> writes:
20
21 > $ declare -A a=b; unset a
22 > *** glibc detected *** /bin/bash: free(): invalid pointer: 0x10091644 ***
23
24 And the obvious patch:
25
26 --- bash-4.1/builtins/declare.def.~1~   2009-11-26 01:42:00.000000000 +0100
27 +++ bash-4.1/builtins/declare.def       2010-04-09 19:20:51.000000000 +0200
28 @@ -512,7 +512,7 @@ declare_internal (list, local_var)
29             {
30               /* let bind_{array,assoc}_variable take care of this. */
31               if (assoc_p (var))
32 -               bind_assoc_variable (var, name, "0", value, aflags);
33 +               bind_assoc_variable (var, name, savestring ("0"), value, aflags);
34               else
35                 bind_array_variable (name, 0, value, aflags);
36             }
37