Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!uwm.edu!linac!att!princeton!pucc!EGNILGES From: EGNILGES@pucc.Princeton.EDU (Ed Nilges) Newsgroups: comp.lang.c Subject: Trouble at EOF Message-ID: <12847@pucc.Princeton.EDU> Date: 16 Jun 91 17:04:35 GMT Reply-To: EGNILGES@pucc.Princeton.EDU Organization: Princeton University, NJ Lines: 11 Disclaimer: Author bears full responsibility for contents of this article According to the description of the standard fgets library function (reference 1), you are not guaranteed newline at the end of every line...that is, you'll get one at the end of the LAST line (or is it the last-1th line, such that the last line is zero length? enquiring minds want to know) only if it's there in the file. I guess it's the old IBMer in me, who wants the end of a line to be the Edge of the World, but this seems a tad bogus, especially if one is writing a lexical analyser where such issues are important. Is there a true line reader in C? One that would slap on an end of line at the end of the last line if it needed it?