Fix REPOSITION-FILE, HISTORY, locked file handle and other problems.
[pforth] / csrc / pfcompil.c
index dcb386f..84546c4 100644 (file)
@@ -927,7 +927,7 @@ ThrowCode ffOuterInterpreterLoop( void )
 }\r
 \r
 /***************************************************************\r
 }\r
 \r
 /***************************************************************\r
-** Include a file\r
+** Include then close a file\r
 ***************************************************************/\r
 \r
 ThrowCode ffIncludeFile( FileStream *InputFile )\r
 ***************************************************************/\r
 \r
 ThrowCode ffIncludeFile( FileStream *InputFile )\r
@@ -963,6 +963,9 @@ ThrowCode ffIncludeFile( FileStream *InputFile )
 /* Pop file stream. */\r
        ffPopInputStream();\r
        \r
 /* Pop file stream. */\r
        ffPopInputStream();\r
        \r
+/* ANSI spec specifies that this should also close the file. */\r
+       sdCloseFile(InputFile);\r
+\r
        return exception;\r
 }\r
 \r
        return exception;\r
 }\r
 \r