7 Bug-Reported-by: Stuart Shelton <srcshelton@gmail.com>
8 Bug-Reference-ID: <619141e40610261203y6cda5aa6i23cb24c7aeba996e@mail.gmail.com>
13 A bug in the parameter pattern substitution implementation treated a pattern
14 whose first character was `/' (after expansion) as specifying global
19 *** bash-3.2/subst.c Tue Sep 19 08:35:09 2006
20 --- bash-3.2/subst.c Thu Oct 26 09:17:50 2006
27 + if (patsub && *patsub == '/')
29 + mflags |= MATCH_GLOBREP;
33 /* Malloc this because expand_string_if_necessary or one of the expansion
34 functions in its call chain may free it on a substitution error. */
39 /* ksh93 doesn't allow the match specifier to be a part of the expanded
40 ! pattern. This is an extension. */
42 ! if (pat && pat[0] == '/')
44 ! mflags |= MATCH_GLOBREP|MATCH_ANY;
47 else if (pat && pat[0] == '#')
53 /* ksh93 doesn't allow the match specifier to be a part of the expanded
54 ! pattern. This is an extension. Make sure we don't anchor the pattern
55 ! at the beginning or end of the string if we're doing global replacement,
58 ! if (mflags & MATCH_GLOBREP)
59 ! mflags |= MATCH_ANY;
60 else if (pat && pat[0] == '#')
63 *** bash-3.2/tests/new-exp.right Thu Aug 10 12:00:00 2006
64 --- bash-3.2/tests/new-exp.right Sun Oct 29 16:03:36 2006
67 Case06---1---A B C::---
70 ! ./new-exp.tests: line 506: /${$(($#-1))}: bad substitution
75 Case06---1---A B C::---
78 ! ./new-exp.tests: line 506: ${$(($#-1))}: bad substitution
82 *** bash-3.2/patchlevel.h Thu Apr 13 08:31:04 2006
83 --- bash-3.2/patchlevel.h Mon Oct 16 14:22:54 2006
86 looks for to find the patch level (for the sccs version string). */
88 ! #define PATCHLEVEL 3
90 #endif /* _PATCHLEVEL_H_ */
92 looks for to find the patch level (for the sccs version string). */
94 ! #define PATCHLEVEL 4
96 #endif /* _PATCHLEVEL_H_ */