Prof A Olowofoyeku (The African Chief) wrote:
The fault is random. If I insert a space after the "." of the last "end." statement, there is no error. If I remove the space so that the dot is the last thing in the file, the error comes back. If I remove all the comments at the top of the file, the error goes away. If I add the comments back, the error comes back. In each case, BufPos = BufCount + 1. Perhaps you just need to allow for the extra byte.
It was indeed an uninitialized-state bug which was triggered (but not caused) by the use of CR/LF -- a rather complicated situation. Thanks for finding it. (I could reproduce it with your file.)
This patch should fix it.
Frank