commit bash-20120914 snapshot

This commit is contained in:
Chet Ramey
2012-10-10 09:36:15 -04:00
parent c84e520283
commit f14388d3aa
23 changed files with 19680 additions and 3830 deletions
+20
View File
@@ -3675,6 +3675,17 @@ eof_error:
}
else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))
; /* don't modify LEX_RESWDOK if we're starting a comment */
/* Allow `do' followed by space, tab, or newline to preserve the
RESWDOK flag, but reset the reserved word length counter so we
can read another one. */
else if MBTEST(((tflags & LEX_INCASE) == 0) &&
(isblank(ch) || ch == '\n') &&
lex_rwlen == 2 &&
STREQN (ret + retind - 2, "do", 2))
{
/*itrace("parse_comsub:%d: lex_incase == 1 found `%c', found \"do\"", line_number, ch);*/
lex_rwlen = 0;
}
else if MBTEST((tflags & LEX_INCASE) && ch != '\n')
/* If we can read a reserved word and we're in case, we're at the
point where we can read a new pattern list or an esac. We
@@ -3690,6 +3701,15 @@ eof_error:
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/
}
#if 0
/* If we find a space or tab but have read something and it's not
`do', turn off the reserved-word-ok flag */
else if MBTEST(isblank (ch) && lex_rwlen > 0)
{
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/
}
#endif
}
/* Might be the start of a here-doc delimiter */