mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +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:
@@ -147,7 +147,7 @@ static AFile* NewAFile (IFile* IF, FILE* F)
|
|||||||
* since we cannot use fileno() (non standard identifier in standard
|
* since we cannot use fileno() (non standard identifier in standard
|
||||||
* header file), and therefore not fstat. When using stat with the
|
* header file), and therefore not fstat. When using stat with the
|
||||||
* file name, there's a risk that the file was deleted and recreated
|
* 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
|
* if a file has changed in the debugger, we will ignore this problem
|
||||||
* here.
|
* here.
|
||||||
*/
|
*/
|
||||||
@@ -437,14 +437,15 @@ int NextLine (void)
|
|||||||
/* Check for EOF */
|
/* Check for EOF */
|
||||||
if (C == EOF) {
|
if (C == EOF) {
|
||||||
|
|
||||||
/* Leave the current file */
|
|
||||||
CloseIncludeFile ();
|
|
||||||
|
|
||||||
/* Accept files without a newline at the end */
|
/* Accept files without a newline at the end */
|
||||||
if (SB_NotEmpty (Line)) {
|
if (SB_NotEmpty (Line)) {
|
||||||
|
++Input->Line;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Leave the current file */
|
||||||
|
CloseIncludeFile ();
|
||||||
|
|
||||||
/* If there is no file open, bail out, otherwise get the
|
/* If there is no file open, bail out, otherwise get the
|
||||||
* previous input file and start over.
|
* previous input file and start over.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user