]>
Commit | Line | Data |
---|---|---|
4e9fe84f JB |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 3.0 | |
5 | Patch-ID: bash30-016 | |
6 | ||
7 | Bug-Reported-by: William Park <opengeometry@yahoo.ca> | |
8 | Bug-Reference-ID: <200411012217.iA1MHxL7031818@node1.opengeometry.net> | |
9 | Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2004-11/msg00017.html | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | Offset from the end of array in ${var: -n} is still off by 1. Eg. | |
14 | x=( {0..9} ) | |
15 | echo ${x[*]: -1} --> 8 9 | |
16 | ||
17 | Patch: | |
18 | ||
19 | *** ../bash-3.0-patched/subst.c Wed Sep 8 11:07:55 2004 | |
20 | --- subst.c Tue Nov 9 16:26:59 2004 | |
21 | *************** | |
22 | *** 4900,4905 **** | |
23 | case VT_ARRAYVAR: | |
24 | a = (ARRAY *)value; | |
25 | ! /* For arrays, the first value deals with array indices. */ | |
26 | ! len = array_max_index (a); /* arrays index from 0 to n - 1 */ | |
27 | break; | |
28 | #endif | |
29 | --- 4900,4906 ---- | |
30 | case VT_ARRAYVAR: | |
31 | a = (ARRAY *)value; | |
32 | ! /* For arrays, the first value deals with array indices. Negative | |
33 | ! offsets count from one past the array's maximum index. */ | |
34 | ! len = array_max_index (a) + (*e1p < 0); /* arrays index from 0 to n - 1 */ | |
35 | break; | |
36 | #endif | |
37 | *** ../bash-3.0-patched/tests/array.tests Sat Oct 4 23:25:00 2003 | |
38 | --- tests/array.tests Tue Nov 9 16:36:29 2004 | |
39 | *************** | |
40 | *** 323,327 **** | |
41 | echo positive offset - expect five seven | |
42 | echo ${av[@]:5:2} | |
43 | ! echo negative offset - expect five seven | |
44 | echo ${av[@]: -2:2} | |
45 | ||
46 | --- 323,327 ---- | |
47 | echo positive offset - expect five seven | |
48 | echo ${av[@]:5:2} | |
49 | ! echo negative offset to unset element - expect seven | |
50 | echo ${av[@]: -2:2} | |
51 | ||
52 | *** ../bash-3.0-patched/tests/array.right Sat Oct 4 23:25:10 2003 | |
53 | --- tests/array.right Tue Nov 9 16:37:25 2004 | |
54 | *************** | |
55 | *** 171,176 **** | |
56 | positive offset - expect five seven | |
57 | five seven | |
58 | ! negative offset - expect five seven | |
59 | ! five seven | |
60 | positive offset 2 - expect seven | |
61 | seven | |
62 | --- 171,176 ---- | |
63 | positive offset - expect five seven | |
64 | five seven | |
65 | ! negative offset to unset element - expect seven | |
66 | ! seven | |
67 | positive offset 2 - expect seven | |
68 | seven | |
69 | *** ../bash-3.0-patched/patchlevel.h Tue Oct 26 17:13:29 2004 | |
70 | --- patchlevel.h Tue Nov 9 16:31:24 2004 | |
71 | *************** | |
72 | *** 26,30 **** | |
73 | looks for to find the patch level (for the sccs version string). */ | |
74 | ||
75 | ! #define PATCHLEVEL 15 | |
76 | ||
77 | #endif /* _PATCHLEVEL_H_ */ | |
78 | --- 26,30 ---- | |
79 | looks for to find the patch level (for the sccs version string). */ | |
80 | ||
81 | ! #define PATCHLEVEL 16 | |
82 | ||
83 | #endif /* _PATCHLEVEL_H_ */ | |
84 |