vhdlpp: Set EOF flag right after reaching the end of file.

This commit is contained in:
Maciej Suminski 2016-02-17 13:55:19 +01:00
parent 83330c22fb
commit 1ed4603a18
1 changed files with 5 additions and 0 deletions

View File

@ -522,6 +522,11 @@ static PLI_INT32 ivlh_readline_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
vpi_put_value(stringh, &val, 0, vpiNoDelay);
free(text);
/* Set end-of-file flag if we have just reached the end of the file.
* Otherwise the flag would be set only after the next read operation. */
int c = fgetc(fp);
ungetc(c, fp);
return 0;
}