mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-08 11:12:36 +02:00
commit bash-20060119 snapshot
This commit is contained in:
@@ -2742,11 +2742,8 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
start_lineno = line_number;
|
||||
while (count)
|
||||
{
|
||||
#if 0
|
||||
ch = shell_getc ((qc != '\'' || (flags & P_ALLOWESC)) && pass_next_character == 0);
|
||||
#else
|
||||
ch = shell_getc (qc != '\'' && pass_next_character == 0);
|
||||
#endif
|
||||
|
||||
if (ch == EOF)
|
||||
{
|
||||
free (ret);
|
||||
@@ -2771,7 +2768,7 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
continue;
|
||||
}
|
||||
/* Not exactly right yet */
|
||||
else if (check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind -1])))
|
||||
else if MBTEST(check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind - 1])))
|
||||
in_comment = 1;
|
||||
|
||||
if (pass_next_character) /* last char was backslash */
|
||||
@@ -2798,11 +2795,9 @@ parse_matched_pair (qc, open, close, lenp, flags)
|
||||
}
|
||||
else if MBTEST(ch == close) /* ending delimiter */
|
||||
count--;
|
||||
#if 1
|
||||
/* handle nested ${...} specially. */
|
||||
else if MBTEST(open != close && was_dollar && open == '{' && ch == open) /* } */
|
||||
count++;
|
||||
#endif
|
||||
else if MBTEST(((flags & P_FIRSTCLOSE) == 0) && ch == open) /* nested begin */
|
||||
count++;
|
||||
|
||||
@@ -2898,7 +2893,11 @@ add_nestret:
|
||||
}
|
||||
else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 0)
|
||||
{
|
||||
nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags);
|
||||
/* Add P_ALLOWESC so backslash quotes the next character and
|
||||
shell_getc does the right thing with \<newline>. We do this for
|
||||
a measure of backwards compatibility -- it's not strictly the
|
||||
right POSIX thing. */
|
||||
nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags|P_ALLOWESC);
|
||||
goto add_nestret;
|
||||
}
|
||||
else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */
|
||||
@@ -2946,7 +2945,6 @@ parse_dparen (c)
|
||||
{
|
||||
wd = alloc_word_desc ();
|
||||
wd->word = wval;
|
||||
wd = make_word (wval);
|
||||
yylval.word_list = make_word_list (wd, (WORD_LIST *)NULL);
|
||||
return (ARITH_FOR_EXPRS);
|
||||
}
|
||||
@@ -3496,7 +3494,7 @@ read_token_word (character)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Try to locale)-expand the converted string. */
|
||||
/* Try to locale-expand the converted string. */
|
||||
ttrans = localeexpand (ttok, 0, ttoklen - 1, first_line, &ttranslen);
|
||||
free (ttok);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user