retro: only use atexit() if the termios stuff is actually used

FossilOrigin-Name: c3a374cb38a0f8805c1e7906c5595c0fecb4c5265acf7fbb72cb81f8d682e7ab
This commit is contained in:
crc 2019-03-21 20:45:33 +00:00
parent dade4cee3a
commit 34606bec09

View file

@ -534,8 +534,8 @@ int main(int argc, char **argv) {
if (modes[FLAG_INTERACTIVE] == 1) {
rre_execute(d_xt_for("banner", Dictionary), 0);
#ifdef USE_TERMIOS
atexit(restore_term);
if (modes[FLAG_CBREAK] == 1) prepare_term();
if (modes[FLAG_CBREAK] == 1) atexit(restore_term);
#endif
if (modes[FLAG_CBREAK] == 1) while (1) rre_execute(0, 0);
if (modes[FLAG_CBREAK] == 0) while (1) rre_execute(0, -1);