Skip to content
Snippets Groups Projects
Commit db98df2e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't require a key-press when exiting a UIFC app run in ANSI mode on Win32

Breaking into a debugger, I found the task was hung in:
_lock_file(stdin) called from common_flush_all(), so the stream was locked.
Simply unlocking it resolves the problem.

This bug has been around forever and was annoying but non-serious (just
required the user/sysop to hit ENTER). So happy it's now fixed.
parent d7ab0225
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -999,6 +999,14 @@ int ansi_initciolib(long inmode)
return(1);
}
void ansi_suspend(void)
{
#if defined _WIN32
// Prevents the wait for a key press when exit() is called and the stdin stream is flushed
_unlock_file(stdin);
#endif
}
CIOLIBEXPORT void CIOLIBCALL ansi_ciolib_setdoorway(int enable)
{
if(cio_api.mode!=CIOLIB_MODE_ANSI)
......
......@@ -70,6 +70,7 @@ int ansi_getch(void);
int ansi_getche(void);
void ansi_beep(void);
void ansi_textmode(int mode);
void ansi_suspend(void);
#ifdef __cplusplus
}
#endif
......
......@@ -322,6 +322,7 @@ static int try_ansi_init(int mode)
cio_api.textmode=ansi_textmode;
cio_api.ESCDELAY=&CIOLIB_ANSI_TIMEOUT;
cio_api.beep=ansi_beep;
cio_api.suspend=ansi_suspend;
return(1);
}
return(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment