commit bash-20091105 snapshot

This commit is contained in:
Chet Ramey
2011-12-08 20:19:59 -05:00
parent 6bf8a8a76a
commit 2695f55d81
16 changed files with 7710 additions and 46 deletions
+19 -4
View File
@@ -3378,6 +3378,8 @@ eof_error:
{
tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC);
/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/
free (heredelim);
heredelim = 0;
lex_firstind = -1;
}
else
@@ -3402,6 +3404,8 @@ eof_error:
{
tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC);
/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/
free (heredelim);
heredelim = 0;
lex_firstind = -1;
}
}
@@ -3482,13 +3486,24 @@ eof_error:
{
if (lex_firstind == -1 && shellbreak (ch) == 0)
lex_firstind = retind;
#if 0
else if (heredelim && (tflags & LEX_PASSNEXT) == 0 && ch == '\n')
{
tflags |= LEX_INHEREDOC;
tflags &= ~LEX_HEREDELIM;
lex_firstind = retind + 1;
}
#endif
else if (lex_firstind >= 0 && (tflags & LEX_PASSNEXT) == 0 && shellbreak (ch))
{
nestret = substring (ret, lex_firstind, retind);
heredelim = string_quote_removal (nestret, 0);
free (nestret);
hdlen = STRLEN(heredelim);
if (heredelim == 0)
{
nestret = substring (ret, lex_firstind, retind);
heredelim = string_quote_removal (nestret, 0);
free (nestret);
hdlen = STRLEN(heredelim);
/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/
}
if (ch == '\n')
{
tflags |= LEX_INHEREDOC;