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:
parent
5b1d4a611f
commit
11fd7f0f16
11
lex.c
11
lex.c
|
@ -215,9 +215,14 @@ enum LexToken LexScanGetToken(struct LexState *Lexer, struct Value **Value)
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (Lexer->Pos == Lexer->End)
|
if (Lexer->Pos == Lexer->End)
|
||||||
{
|
{ /* end of input */
|
||||||
char LineBuffer[LINEBUFFER_MAX];
|
if (Lexer->FileName == StrEmpty)
|
||||||
if (fgets(&LineBuffer[0], LINEBUFFER_MAX, stdin) == NULL)
|
{ /* get interactive input */
|
||||||
|
char LineBuffer[LINEBUFFER_MAX];
|
||||||
|
if (fgets(&LineBuffer[0], LINEBUFFER_MAX, stdin) == NULL)
|
||||||
|
return TokenEOF;
|
||||||
|
}
|
||||||
|
else
|
||||||
return TokenEOF;
|
return TokenEOF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue