1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-09 22:29:35 +00:00

Fixed a problem with files that don't end with a newline

git-svn-id: svn://svn.cc65.org/cc65/trunk@3697 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2006-01-20 21:17:08 +00:00
parent 1193a466d9
commit 45ffbc59f5

View File

@ -147,7 +147,7 @@ static AFile* NewAFile (IFile* IF, FILE* F)
* since we cannot use fileno() (non standard identifier in standard
* header file), and therefore not fstat. When using stat with the
* file name, there's a risk that the file was deleted and recreated
* while it was open. Since mtime and size are only used to check
* while it was open. Since mtime and size are only used to check
* if a file has changed in the debugger, we will ignore this problem
* here.
*/
@ -437,14 +437,15 @@ int NextLine (void)
/* Check for EOF */
if (C == EOF) {
/* Leave the current file */
CloseIncludeFile ();
/* Accept files without a newline at the end */
if (SB_NotEmpty (Line)) {
++Input->Line;
break;
}
/* Leave the current file */
CloseIncludeFile ();
/* If there is no file open, bail out, otherwise get the
* previous input file and start over.
*/