mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 02:02:42 +02:00
commit bash-20130328 snapshot
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user