Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COMMAND2] Counter in uninitialised memory causes pause prompt on program termination with error #144

Open
grauw opened this issue Dec 7, 2024 · 0 comments

Comments

@grauw
Copy link

grauw commented Dec 7, 2024

When you terminate a program with an error code (e.g. when pressing CTRL-C), it is possible for the “Press any key to continue” message to appear as if the PAUSE command was used or a /P pager option was passed to a command.

This is because the value at address 6499H (LINES) used by COMMAND2.COM, used to support the /P pager option in some commands, is uninitialised when the program returns with an error. Specifically, this seems to trigger in OUCH. I think REBOOT fails to properly clear this vars area.

I’ve even seen this to cause the “*** CTRL-C pressed” “Terminate batch file (Y/N)?” message to be truncated, probably because other variables (like CHRFLG) are also uninitialised.

A workaround is to set 6499H to 0 before the program terminates.

Test case: pausebug.zip

Just run it from the command line and notice the pause prompt that appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant