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
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.
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
27 return (struct globval *)0;
31 ! if (r && r != &glob_error_return)
33 return (struct globval *)0;
38 ! /* compat: if GX_ALLDIRS, add the passed directory also */
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)
52 nextlink->next = lastlink;
54 ! if (flags & GX_NULLDIR)
57 ! bcopy (dir, nextname, sdlen + 1);
61 nextlink->next = lastlink;
63 ! bcopy (dir, nextname, sdlen + 1);
68 register unsigned int l;
70 ! array = glob_dir_to_array (directories[i], temp_results, flags);
72 while (array[l] != NULL)
74 register unsigned int l;
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;
81 ! array = glob_dir_to_array (directories[i], temp_results, flags);
83 while (array[l] != NULL)
87 /* Note that the elements of ARRAY are not freed. */
88 ! free ((char *) array);
93 /* Note that the elements of ARRAY are not freed. */
94 ! if (array != temp_results)
95 ! free ((char *) array);
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
102 looks for to find the patch level (for the sccs version string). */
104 ! #define PATCHLEVEL 23
106 #endif /* _PATCHLEVEL_H_ */
108 looks for to find the patch level (for the sccs version string). */
110 ! #define PATCHLEVEL 24
112 #endif /* _PATCHLEVEL_H_ */