Closed heasm66 closed 1 year ago
I tried the recently added help files for 810722, but I had to make this change to Confusion to get the help file to display properly.
diff --git a/confusion_patched/macros.cpp b/confusion_patched/macros.cpp
index a25eb6a..cfb19db 100644
--- a/confusion_patched/macros.cpp
+++ b/confusion_patched/macros.cpp
@@ -7413,7 +7413,7 @@ mdl_value_t *mdl_builtin_eval_file_length(mdl_value_t *form, mdl_value_t *args)
return mdl_call_error_ext("CHANNEL-CLOSED", "Channel closed but nonzero", NULL); // shouldn't happen
if (fgetpos(f,&savepos) == -1)
return mdl_call_error("FILE-LENGTH-UNAVAILABLE", NULL); // not an original MDL error
- if (fseek(f, SEEK_END, 0) == -1)
+ if (fseek(f, 0, SEEK_END) == -1)
return mdl_call_error("FILE-LENGTH-UNAVAILABLE", NULL); // not an original MDL error
endpos = ftello(f);
fsetpos(f, &savepos);
(And you don't want to know how long I stared at that before noticing the error!)
Yeah, I noticed yesterday that it didn't work but it was past my bedtime...
I got as far as noticing that when reading an external file it couldn't iterate over the file multiple times but just read the buffer full, printed it and then exited. Obviously it always returned that it reached the end. My first impulse was to use a big enough buffer (memory isn't such a contraint any more on modern machines) to get all text on the first reading but your solution to fix the root of the problem is much better, Thank you!
@eswenson1 supplied me with more files (from not publically available sources). I updated the firt post with information.
I saw you filed an upstreams bug report. Thanks! That was something I didn't have the time to do this morning. I barely had the time to write a proper bug report here.
It took me an embarrassingly long time to figure out why it always reported a file size of 2 bytes, but of course it was in essence doing fseek(f, 2, SEEK_SET) instead of fseek(f, 0, SEEK_END). :-)
Add the different help and info textfiles so they work under Confusion.
madadv.help 770606 https://github.com/MITDDC/zork-1977-07/blob/main/zork/9006255/madman/madadv.help 771214 https://github.com/MITDDC/zork/blob/master/zork/madman/madadv.help 780111
780124 https://github.com/MITDDC/zork-1978-01/blob/main/zork/madman/madadv.help
780808
790317 , identical to 890108
890108 https://github.com/MITDDC/zork-1989-01/tree/main/zork/cstacy
010815
madadv.info 770607 https://github.com/MITDDC/zork-1977-07/blob/main/zork/9006255/madman/madadv.info 770614 https://github.com/MITDDC/zork-1977-07/blob/main/zork/9005183/madman/madadv.info 790317
890108 https://github.com/MITDDC/zork-1989-01/blob/main/zork/cstacy/madadv.info
010815
madadv.doc 790406, ver 1, broken but identical to ver 2 up to that part.
790406 , ver 2
Games (source code or executables) understand only
HELP
andINFO
up until the 780402 version. The 1979 version is the first that also understandsDOC
.The most suitable distribution of the text-files among the known executables and snapshots of source code: