lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> /* EOF flag checked here because when lf->f is a terminal, the fread
>    may return > 0 even when it is set.  If you call fread again and
>    lf->f is a terminal it will wait for the next line or CTRL-D. */

Actually I think the exact problem is a little different: fread can
return > 0  *and* set the EOF flag. The next time getF is called, if
you call fread, then the terminal will wait for user input. By calling
feof before fread, you avoid this wait.