Fixed handling of interactive input at EOF

git-svn-id: http://picoc.googlecode.com/svn/trunk@58 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2009-02-03 00:23:13 +00:00
parent 5b1d4a611f
commit 11fd7f0f16

11
lex.c
View file

@ -215,9 +215,14 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value)
do
{
if (Lexer->Pos == Lexer->End)
{
char LineBuffer[LINEBUFFER_MAX];
if (fgets(&LineBuffer[0], LINEBUFFER_MAX, stdin) == NULL)
{ /* end of input */
if (Lexer->FileName == StrEmpty)
{ /* get interactive input */
char LineBuffer[LINEBUFFER_MAX];
if (fgets(&LineBuffer[0], LINEBUFFER_MAX, stdin) == NULL)
return TokenEOF;
}
else
return TokenEOF;
}