commit bash-20130328 snapshot

This commit is contained in:
Chet Ramey
2013-04-26 15:19:32 -04:00
parent c2fa658335
commit 1e8fce0f8d
12 changed files with 5333 additions and 368 deletions
+14 -2
View File
@@ -3301,6 +3301,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
treat single quotes as special when inside a double-quoted
${...}. This logic must agree with subst.c:extract_dollar_brace_string
since they share the same defines. */
/* FLAG POSIX INTERP 221 */
if (flags & P_DOLBRACE)
{
/* ${param%[%]word} */
@@ -3311,7 +3312,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
dolbrace_state = DOLBRACE_QUOTE;
/* ${param/[/]pat/rep} */
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '/' && retind > 1)
dolbrace_state = DOLBRACE_QUOTE;
dolbrace_state = DOLBRACE_OP; /* XXX */
/* ${param^[^]pat} */
else if MBTEST(dolbrace_state == DOLBRACE_PARAM && ch == '^' && retind > 1)
dolbrace_state = DOLBRACE_QUOTE;
@@ -3353,7 +3354,18 @@ parse_matched_pair (qc, open, close, lenp, flags)
ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen);
xfree (nestret);
if ((rflags & P_DQUOTE) == 0)
/* If we're parsing a double-quoted brace expansion and we are
not in a place where single quotes are treated specially,
make sure we single-quote the results of the ansi
expansion because quote removal should remove them later */
/* FLAG POSIX INTERP 221 */
if ((shell_compatibility_level > 41) && (rflags & P_DQUOTE) && (dolbrace_state != DOLBRACE_QUOTE) && (flags & P_DOLBRACE))
{
nestret = sh_single_quote (ttrans);
free (ttrans);
nestlen = strlen (nestret);
}
else if ((rflags & P_DQUOTE) == 0)
{
nestret = sh_single_quote (ttrans);
free (ttrans);