]>
Commit | Line | Data |
---|---|---|
fb8ce753 AM |
1 | BASH PATCH REPORT |
2 | ================= | |
3 | ||
4 | Bash-Release: 4.0 | |
5 | Patch-ID: bash40-024 | |
6 | ||
7 | Bug-Reported-by: Matt Zyzik <matt.zyzik@nyu.edu> | |
8 | Bug-Reference-ID: <20090405205428.4FDEA1C7175@ice.filescope.com> | |
9 | Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00021.html | |
10 | ||
11 | Bug-Description: | |
12 | ||
13 | When using the ** globbing operator, bash will incorrectly add an extra | |
14 | directory name when the preceding directory name ends with `*' or an empty | |
15 | string when there is no preceding directory name. | |
16 | ||
17 | Patch: | |
18 | ||
19 | *** ../bash-4.0-patched/lib/glob/glob.c 2009-01-04 14:32:30.000000000 -0500 | |
20 | --- lib/glob/glob.c 2009-04-28 10:22:29.000000000 -0400 | |
21 | *************** | |
22 | *** 357,361 **** | |
23 | if (ep) | |
24 | *ep = 0; | |
25 | ! if (r) | |
26 | free (r); | |
27 | return (struct globval *)0; | |
28 | --- 357,361 ---- | |
29 | if (ep) | |
30 | *ep = 0; | |
31 | ! if (r && r != &glob_error_return) | |
32 | free (r); | |
33 | return (struct globval *)0; | |
34 | *************** | |
35 | *** 666,671 **** | |
36 | } | |
37 | ||
38 | ! /* compat: if GX_ALLDIRS, add the passed directory also */ | |
39 | ! if (add_current) | |
40 | { | |
41 | sdlen = strlen (dir); | |
42 | --- 666,672 ---- | |
43 | } | |
44 | ||
45 | ! /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an | |
46 | ! empty directory name. */ | |
47 | ! if (add_current && (flags & GX_NULLDIR) == 0) | |
48 | { | |
49 | sdlen = strlen (dir); | |
50 | *************** | |
51 | *** 679,686 **** | |
52 | nextlink->next = lastlink; | |
53 | lastlink = nextlink; | |
54 | ! if (flags & GX_NULLDIR) | |
55 | ! nextname[0] = '\0'; | |
56 | ! else | |
57 | ! bcopy (dir, nextname, sdlen + 1); | |
58 | ++count; | |
59 | } | |
60 | --- 680,684 ---- | |
61 | nextlink->next = lastlink; | |
62 | lastlink = nextlink; | |
63 | ! bcopy (dir, nextname, sdlen + 1); | |
64 | ++count; | |
65 | } | |
66 | *************** | |
67 | *** 943,947 **** | |
68 | register unsigned int l; | |
69 | ||
70 | ! array = glob_dir_to_array (directories[i], temp_results, flags); | |
71 | l = 0; | |
72 | while (array[l] != NULL) | |
73 | --- 941,950 ---- | |
74 | register unsigned int l; | |
75 | ||
76 | ! /* If we're expanding **, we don't need to glue the directory | |
77 | ! name to the results; we've already done it in glob_vector */ | |
78 | ! if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') | |
79 | ! array = temp_results; | |
80 | ! else | |
81 | ! array = glob_dir_to_array (directories[i], temp_results, flags); | |
82 | l = 0; | |
83 | while (array[l] != NULL) | |
84 | *************** | |
85 | *** 960,964 **** | |
86 | ||
87 | /* Note that the elements of ARRAY are not freed. */ | |
88 | ! free ((char *) array); | |
89 | } | |
90 | } | |
91 | --- 963,968 ---- | |
92 | ||
93 | /* Note that the elements of ARRAY are not freed. */ | |
94 | ! if (array != temp_results) | |
95 | ! free ((char *) array); | |
96 | } | |
97 | } | |
98 | *** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 | |
99 | --- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 | |
100 | *************** | |
101 | *** 26,30 **** | |
102 | looks for to find the patch level (for the sccs version string). */ | |
103 | ||
104 | ! #define PATCHLEVEL 23 | |
105 | ||
106 | #endif /* _PATCHLEVEL_H_ */ | |
107 | --- 26,30 ---- | |
108 | looks for to find the patch level (for the sccs version string). */ | |
109 | ||
110 | ! #define PATCHLEVEL 24 | |
111 | ||
112 | #endif /* _PATCHLEVEL_H_ */ |