aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/alan3/exe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/glk/alan3/exe.cpp')
-rw-r--r--engines/glk/alan3/exe.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/glk/alan3/exe.cpp b/engines/glk/alan3/exe.cpp
index 34c9c615d9..5c6f09b2b7 100644
--- a/engines/glk/alan3/exe.cpp
+++ b/engines/glk/alan3/exe.cpp
@@ -50,10 +50,12 @@
namespace Glk {
namespace Alan3 {
-/* PUBLIC DATA */
-
+// PUBLIC DATA
Common::SeekableReadStream *textFile;
+// PUBLIC DATA - formerly method statics
+bool printFlag; // Printing already?
+
/* Long jump buffers */
// TODO move to longjump.c? or error.c, and abstract them into functions?
//jmp_buf restartLabel; /* Restart long jump return point */
@@ -94,7 +96,6 @@ void print(Aword fpos, Aword len) {
int ch = 0;
int i;
long savfp = 0; /* Temporary saved text file position */
- static bool printFlag = FALSE; /* Printing already? */
bool savedPrintFlag = printFlag;
void *info = NULL; /* Saved decoding info */
@@ -126,9 +127,10 @@ void print(Aword fpos, Aword len) {
else
ch = textFile->readByte();
+ if (ch == EOFChar)
+ break; // Or end of text?
+
str[i] = ch;
- if (textFile->pos() >= textFile->size()) /* Or end of text? */
- break;
}
str[i] = '\0';