Commit db98df2e authored by Rob Swindell's avatar Rob Swindell 💬
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
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment