BWBasic 3.2 freezes after entering run#
Brought to you by:
kerravon86,
tcamp
I wrote a small BASIC listing and accidentally pressed the "#" key before pressing the return key after i entered run. The result was, that the BWBASIC interpreter freezes when run#
is entered instead of run
.
The "#" key is next to the "RETURN" key on a German keyboard layout. Therefore, it is not difficult to accidentally press it when trying to press RETURN.
Thanks for finding this bug. Sorry for the delay in responding - I am not often online. If you are comfortable updating the source code with diff/patch, the attached "patch-20230417.txt" should fix this bug and all the other bugs I know about.
If you are not comfortable with diff/patch, then open "bwb_cmd.c" with a text editor and goto to around line 1555, which should look like this:
Update that section to this:
After recompiling the following test confirms that bug is fixed.
Thank you a lot for fixing that bug. Your fix worked. But i found another bug that is related to this bug.
BWBasic freezes when trying to run code starting with a line number that is not in the code listing.
I used your code listing example above and entered:
And after pressing the return key, BWBasic freezes. See the screenshot below.
The same applies for variants like this one:
or
I added your fix manually. I didn't use the diff patch because I didn't have the appropriate diff software installed in FreeDOS 1.3.
Last edit: Oliver 2023-04-18
As an additional information to my last comment:
I was curious how GW-BASIC reacts when entering a line number that doesn't exist.
When trying to do so, it prints the line:
And returns to the GW-BASIC interpreter.
See screenshot as an example:
Last edit: Oliver 2023-04-18
One more information.
I found out that it is possible to switch back to the interpreter by pressing
CTRL + C when a none existing line number was given to run the basic code.
The problem with this is, BWBasic returns to the interpreter only, when only a number like
was given and the keys CTRL+C was pressed
If i enter a number with a # character
and then press the CTRL+C key, then BWBasic exists or crashes to DOS prompt.
But from there, the memory seems to be rather corrupted, because additional DOS commands, for example
do throw an exception.
Thus BWBasic doesn't exit in a clean way at this point.
See the screenshots for example.
Last edit: Oliver 2023-04-18
Glad the initial bug is fixed. The attached "patch-20230419.txt" should fix the second bug you reported above.
After recompiling the following test should confirm the second bug is fixed.
Thank you very much.
I can report that your second patch fixed the second bug.
I did your test and everything worked like it should.
Great work!