Eliminate global eof variable.